def _recreate_table(self, table, column=None, delta=None, omit_uniques=None):

    table_name = self.preparer.format_table(table)

    # we remove all indexes so as not to have
    # problems during copy and re-create
    for index in table.indexes:
        index.drop()

    # reflect existing unique constraints
    for uc in self._get_unique_constraints(table):
        table.append_constraint(uc)
    # omit given unique constraints when creating a new table if required
    table.constraints = set([
        cons for cons in table.constraints
        if omit_uniques is None or cons.name not in omit_uniques
    ])

    self.append('ALTER TABLE %s RENAME TO migration_tmp' % table_name)
    self.execute()

    insertion_string = self._modify_table(table, column, delta)

    table.create(bind=self.connection)
    self.append(insertion_string % {'table_name': table_name})
    self.execute()
    self.append('DROP TABLE migration_tmp')
    self.execute()
Update metadata
dataset/ETHPy150Open openstack/rack/rack/openstack/common/db/sqlalchemy/migration.py/_recreate_table--crossover with--dataset/ETHPy150Open openstack/python-openstacksdk/openstack/compute/v2/metadata.py/MetadataMixin.set_metadata