(self)
| 1145 | ) |
| 1146 | |
| 1147 | def test_change_schema(self): |
| 1148 | meta = MetaData() |
| 1149 | |
| 1150 | table = Table( |
| 1151 | "mytable", |
| 1152 | meta, |
| 1153 | Column("myid", Integer, primary_key=True), |
| 1154 | Column("name", String(40), nullable=True), |
| 1155 | Column( |
| 1156 | "description", String(30), CheckConstraint("description='hi'") |
| 1157 | ), |
| 1158 | UniqueConstraint("name"), |
| 1159 | ) |
| 1160 | |
| 1161 | table2 = Table( |
| 1162 | "othertable", |
| 1163 | meta, |
| 1164 | Column("id", Integer, primary_key=True), |
| 1165 | Column("myid", Integer, ForeignKey("mytable.myid")), |
| 1166 | ) |
| 1167 | |
| 1168 | meta2 = MetaData() |
| 1169 | table_c = table.to_metadata(meta2, schema="someschema") |
| 1170 | table2_c = table2.to_metadata(meta2, schema="someschema") |
| 1171 | |
| 1172 | eq_( |
| 1173 | str(table_c.join(table2_c).onclause), |
| 1174 | str(table_c.c.myid == table2_c.c.myid), |
| 1175 | ) |
| 1176 | eq_( |
| 1177 | str(table_c.join(table2_c).onclause), |
| 1178 | "someschema.mytable.myid = someschema.othertable.myid", |
| 1179 | ) |
| 1180 | |
| 1181 | def test_retain_table_schema(self): |
| 1182 | meta = MetaData() |
nothing calls this directly
no test coverage detected