def test_create_table(self): schema_obj = schemaobj.SchemaObjects() table = schema_obj.table( "x", Column("q", Integer), postgresql_partition_by="x", prefixes=["FOREIGN"], info={"custom": "value"}, comment="some comment", ) op = ops.CreateTableOp.from_table(table) is_not_(op.to_table(), table) eq_(op.to_table().comment, table.comment) eq_(op.to_table().info, table.info) eq_(op.to_table()._prefixes, table._prefixes)
def test_create_table(self): schema_obj = schemaobj.SchemaObjects() table = schema_obj.table('x', Column('q', Integer)) op = ops.CreateTableOp.from_table(table) is_( op.to_table(), table )
def test_create_table_add_kw(self): schema_obj = schemaobj.SchemaObjects() table = schema_obj.table("x", Column("q", Integer)) op = ops.CreateTableOp.from_table(table) op.kw["postgresql_partition_by"] = "x" eq_(op.to_table().dialect_kwargs["postgresql_partition_by"], "x") eq_( op.reverse().to_table().dialect_kwargs["postgresql_partition_by"], "x", )
def test_create_table(self): schema_obj = schemaobj.SchemaObjects() table = schema_obj.table("x", Column("q", Integer)) op = ops.CreateTableOp.from_table(table) is_(op.to_table(), table)
def test_drop_table(self): schema_obj = schemaobj.SchemaObjects() table = schema_obj.table('x', Column('q', Integer)) op = ops.DropTableOp.from_table(table) is_(op.to_table(), table)
def test_drop_table(self): schema_obj = schemaobj.SchemaObjects() table = schema_obj.table("x", Column("q", Integer)) op = ops.DropTableOp.from_table(table) is_(op.to_table(), table)