(self)
| 1244 | ) |
| 1245 | |
| 1246 | def test_retain_table_schema(self): |
| 1247 | meta = MetaData() |
| 1248 | |
| 1249 | table = Table( |
| 1250 | "mytable", |
| 1251 | meta, |
| 1252 | Column("myid", Integer, primary_key=True), |
| 1253 | Column("name", String(40), nullable=True), |
| 1254 | Column( |
| 1255 | "description", String(30), CheckConstraint("description='hi'") |
| 1256 | ), |
| 1257 | UniqueConstraint("name"), |
| 1258 | schema="myschema", |
| 1259 | ) |
| 1260 | |
| 1261 | table2 = Table( |
| 1262 | "othertable", |
| 1263 | meta, |
| 1264 | Column("id", Integer, primary_key=True), |
| 1265 | Column("myid", Integer, ForeignKey("myschema.mytable.myid")), |
| 1266 | schema="myschema", |
| 1267 | ) |
| 1268 | |
| 1269 | meta2 = MetaData() |
| 1270 | table_c = table.to_metadata(meta2) |
| 1271 | table2_c = table2.to_metadata(meta2) |
| 1272 | |
| 1273 | eq_( |
| 1274 | str(table_c.join(table2_c).onclause), |
| 1275 | str(table_c.c.myid == table2_c.c.myid), |
| 1276 | ) |
| 1277 | eq_( |
| 1278 | str(table_c.join(table2_c).onclause), |
| 1279 | "myschema.mytable.myid = myschema.othertable.myid", |
| 1280 | ) |
| 1281 | |
| 1282 | def test_change_name_retain_metadata(self): |
| 1283 | meta = MetaData() |
nothing calls this directly
no test coverage detected