diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-08-12 17:30:23 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-08-12 17:31:15 +0200 |
| commit | 3848475eeb5ee8f7729440f50c04fd85cf8bea66 (patch) | |
| tree | 0b8ba219503a95383e58ac36bccc24b5719d1c63 /django | |
| parent | 04ec8bf92a0c3f3d89adbc38a187f972b8424941 (diff) | |
[4.1.x] Fixed #33919 -- Fixed adding AutoFields on PostgreSQL.
Thanks Jack Calvin Brown for the report.
Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
Backport of 5c803bc0702511c8bc05e9db600367a465514f82 from main
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/base/schema.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 54f13be798..dbc6e427a9 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -637,6 +637,8 @@ class BaseDatabaseSchemaEditor: # It might not actually have a column behind it if definition is None: return + if col_type_suffix := field.db_type_suffix(connection=self.connection): + definition += f" {col_type_suffix}" # Check constraints can go on the column SQL here db_params = field.db_parameters(connection=self.connection) if db_params["check"]: |
