(self)
| 1179 | ) |
| 1180 | |
| 1181 | def test_retain_table_schema(self): |
| 1182 | meta = MetaData() |
| 1183 | |
| 1184 | table = Table( |
| 1185 | "mytable", |
| 1186 | meta, |
| 1187 | Column("myid", Integer, primary_key=True), |
| 1188 | Column("name", String(40), nullable=True), |
| 1189 | Column( |
| 1190 | "description", String(30), CheckConstraint("description='hi'") |
| 1191 | ), |
| 1192 | UniqueConstraint("name"), |
| 1193 | schema="myschema", |
| 1194 | ) |
| 1195 | |
| 1196 | table2 = Table( |
| 1197 | "othertable", |
| 1198 | meta, |
| 1199 | Column("id", Integer, primary_key=True), |
| 1200 | Column("myid", Integer, ForeignKey("myschema.mytable.myid")), |
| 1201 | schema="myschema", |
| 1202 | ) |
| 1203 | |
| 1204 | meta2 = MetaData() |
| 1205 | table_c = table.to_metadata(meta2) |
| 1206 | table2_c = table2.to_metadata(meta2) |
| 1207 | |
| 1208 | eq_( |
| 1209 | str(table_c.join(table2_c).onclause), |
| 1210 | str(table_c.c.myid == table2_c.c.myid), |
| 1211 | ) |
| 1212 | eq_( |
| 1213 | str(table_c.join(table2_c).onclause), |
| 1214 | "myschema.mytable.myid = myschema.othertable.myid", |
| 1215 | ) |
| 1216 | |
| 1217 | def test_change_name_retain_metadata(self): |
| 1218 | meta = MetaData() |
nothing calls this directly
no test coverage detected