def idmap_create(connection):
    """
	Create the _idmap_ table.  This table has columns "table_name",
	"old", and "new" mapping old IDs to new IDs for each table.  The
	(table_name, old) column pair is a primary key (is indexed and must
	contain unique entries).  The table is created as a temporary
	table, so it will be automatically dropped when the database
	connection is closed.

	This function is for internal use, it forms part of the code used
	to re-map row IDs when merging multiple documents.
	"""
    connection.cursor().execute(
        'CREATE TEMPORARY TABLE _idmap_ (table_name TEXT NOT NULL, old INTEGER NOT NULL, new INTEGER NOT NULL, PRIMARY KEY (table_name, old))'
        )
