From 2eea361eff58dd98c409c5227064b901f41bd0d6 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Thu, 24 Mar 2022 16:46:19 +0100 Subject: Fixed #30511 -- Used identity columns instead of serials on PostgreSQL. --- tests/backends/postgresql/test_introspection.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/backends/postgresql') diff --git a/tests/backends/postgresql/test_introspection.py b/tests/backends/postgresql/test_introspection.py index dc95d6ad23..2dfb7514d6 100644 --- a/tests/backends/postgresql/test_introspection.py +++ b/tests/backends/postgresql/test_introspection.py @@ -27,3 +27,18 @@ class DatabaseSequenceTests(TestCase): seqs, [{"table": Person._meta.db_table, "column": "id", "name": "pers_seq"}], ) + + def test_get_sequences_old_serial(self): + with connection.cursor() as cursor: + cursor.execute("CREATE TABLE testing (serial_field SERIAL);") + seqs = connection.introspection.get_sequences(cursor, "testing") + self.assertEqual( + seqs, + [ + { + "table": "testing", + "column": "serial_field", + "name": "testing_serial_field_seq", + } + ], + ) -- cgit v1.3