1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #31300 -- Added GeneratedField model field.

Thanks Adam Johnson and Paolo Melchiorre for reviews.

Co-Authored-By: Lily Foote <code@lilyf.org>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
Jeremy Nauta
2023-07-06 20:36:48 -06:00
committed by Mariusz Felisiak
parent cafe7266ee
commit f333e3513e
22 changed files with 807 additions and 11 deletions

View File

@@ -91,7 +91,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
interface.
"""
cursor.execute(
"PRAGMA table_info(%s)" % self.connection.ops.quote_name(table_name)
"PRAGMA table_xinfo(%s)" % self.connection.ops.quote_name(table_name)
)
table_info = cursor.fetchall()
if not table_info:
@@ -129,7 +129,13 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
pk == 1,
name in json_columns,
)
for cid, name, data_type, notnull, default, pk in table_info
for cid, name, data_type, notnull, default, pk, hidden in table_info
if hidden
in [
0, # Normal column.
2, # Virtual generated column.
3, # Stored generated column.
]
]
def get_sequences(self, cursor, table_name, table_fields=()):