diff options
Diffstat (limited to 'django/db/backends/postgresql/base.py')
-rw-r--r-- | django/db/backends/postgresql/base.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 630da22964..2758c402ab 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -72,8 +72,8 @@ class DatabaseWrapper(BaseDatabaseWrapper): # be interpolated against the values of Field.__dict__ before being output. # If a column type is set to None, it won't be included in the output. data_types = { - "AutoField": "serial", - "BigAutoField": "bigserial", + "AutoField": "integer", + "BigAutoField": "bigint", "BinaryField": "bytea", "BooleanField": "boolean", "CharField": "varchar(%(max_length)s)", @@ -94,7 +94,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): "PositiveIntegerField": "integer", "PositiveSmallIntegerField": "smallint", "SlugField": "varchar(%(max_length)s)", - "SmallAutoField": "smallserial", + "SmallAutoField": "smallint", "SmallIntegerField": "smallint", "TextField": "text", "TimeField": "time", @@ -105,6 +105,11 @@ class DatabaseWrapper(BaseDatabaseWrapper): "PositiveIntegerField": '"%(column)s" >= 0', "PositiveSmallIntegerField": '"%(column)s" >= 0', } + data_types_suffix = { + "AutoField": "GENERATED BY DEFAULT AS IDENTITY", + "BigAutoField": "GENERATED BY DEFAULT AS IDENTITY", + "SmallAutoField": "GENERATED BY DEFAULT AS IDENTITY", + } operators = { "exact": "= %s", "iexact": "= UPPER(%s)", |