Fixed #30511 -- Used identity columns instead of serials on PostgreSQL.

This commit is contained in:
Florian Apolloner 2022-03-24 16:46:19 +01:00 committed by Mariusz Felisiak
parent 62ffc9883a
commit 2eea361eff
7 changed files with 90 additions and 95 deletions

View file

@ -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",
}
],
)