def setUp(self): super(TestSqliteUniqueConstraints, self).setUp() migration.patch_migrate() self.helper = sqlite.SQLiteHelper() sa.Table( 'test_table', sa.schema.MetaData(bind=session.get_engine()), sa.Column('a', sa.Integer), sa.Column('b', sa.String(10)), sa.Column('c', sa.Integer), sa.UniqueConstraint('a', 'b', name='unique_a_b'), sa.UniqueConstraint('b', 'c', name='unique_b_c') ).create() # NOTE(rpodolyaka): it's important to use the reflected table here # rather than original one because this is what # we actually do in db migrations code self.reflected_table = sa.Table( 'test_table', sa.schema.MetaData(bind=session.get_engine()), autoload=True )
def setUp(self): super(TestSqliteUniqueConstraints, self).setUp() migration.patch_migrate() self.helper = sqlite.SQLiteHelper() test_table = sa.Table( "test_table", sa.schema.MetaData(bind=session.get_engine()), sa.Column("a", sa.Integer), sa.Column("b", sa.String(10)), sa.Column("c", sa.Integer), sa.UniqueConstraint("a", "b", name="unique_a_b"), sa.UniqueConstraint("b", "c", name="unique_b_c"), ) test_table.create() self.addCleanup(test_table.drop) # NOTE(rpodolyaka): it's important to use the reflected table here # rather than original one because this is what # we actually do in db migrations code self.reflected_table = sa.Table("test_table", sa.schema.MetaData(bind=session.get_engine()), autoload=True)
def setUp(self): super(TestMigrationUtils, self).setUp() migration.patch_migrate()