(self, connection)
| 524 | @testing.requires.sequences_as_server_defaults |
| 525 | @testing.provide_metadata |
| 526 | def test_shared_sequence(self, connection): |
| 527 | # test case for #6071 |
| 528 | common_seq = normalize_sequence( |
| 529 | config, Sequence("common_sequence", metadata=self.metadata) |
| 530 | ) |
| 531 | Table( |
| 532 | "table_1", |
| 533 | self.metadata, |
| 534 | Column( |
| 535 | "id", |
| 536 | Integer, |
| 537 | common_seq, |
| 538 | server_default=common_seq.next_value(), |
| 539 | primary_key=True, |
| 540 | ), |
| 541 | ) |
| 542 | Table( |
| 543 | "table_2", |
| 544 | self.metadata, |
| 545 | Column( |
| 546 | "id", |
| 547 | Integer, |
| 548 | common_seq, |
| 549 | server_default=common_seq.next_value(), |
| 550 | primary_key=True, |
| 551 | ), |
| 552 | ) |
| 553 | |
| 554 | self.metadata.create_all(connection) |
| 555 | is_true(self._has_sequence(connection, "common_sequence")) |
| 556 | is_true(testing.db.dialect.has_table(connection, "table_1")) |
| 557 | is_true(testing.db.dialect.has_table(connection, "table_2")) |
| 558 | self.metadata.drop_all(connection) |
| 559 | is_false(self._has_sequence(connection, "common_sequence")) |
| 560 | is_false(testing.db.dialect.has_table(connection, "table_1")) |
| 561 | is_false(testing.db.dialect.has_table(connection, "table_2")) |
| 562 | |
| 563 | def test_next_value_type(self): |
| 564 | seq = normalize_sequence( |
nothing calls this directly
no test coverage detected