(self, metadata)
| 1404 | ) |
| 1405 | |
| 1406 | def visit_metadata(self, metadata): |
| 1407 | if self.tables is not None: |
| 1408 | tables = self.tables |
| 1409 | else: |
| 1410 | tables = list(metadata.tables.values()) |
| 1411 | |
| 1412 | collection = sort_tables_and_constraints( |
| 1413 | [t for t in tables if self._can_create_table(t)] |
| 1414 | ) |
| 1415 | |
| 1416 | seq_coll = [ |
| 1417 | s |
| 1418 | for s in metadata._sequences.values() |
| 1419 | if s.column is None and self._can_create_sequence(s) |
| 1420 | ] |
| 1421 | |
| 1422 | event_collection = [t for (t, fks) in collection if t is not None] |
| 1423 | |
| 1424 | with self.with_ddl_events( |
| 1425 | metadata, |
| 1426 | tables=event_collection, |
| 1427 | checkfirst=self.checkfirst, |
| 1428 | ): |
| 1429 | for seq in seq_coll: |
| 1430 | self.traverse_single(seq, create_ok=True) |
| 1431 | |
| 1432 | for table, fkcs in collection: |
| 1433 | if table is not None: |
| 1434 | self.traverse_single( |
| 1435 | table, |
| 1436 | create_ok=True, |
| 1437 | include_foreign_key_constraints=fkcs, |
| 1438 | _is_metadata_operation=True, |
| 1439 | ) |
| 1440 | else: |
| 1441 | for fkc in fkcs: |
| 1442 | self.traverse_single(fkc) |
| 1443 | |
| 1444 | def visit_table( |
| 1445 | self, |
nothing calls this directly
no test coverage detected