1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #30664 -- Fixed migrations crash when altering AutoField/BigAutoField with quoted db_column on PostgreSQL.

This commit is contained in:
Mariusz Felisiak
2019-08-01 11:20:56 +02:00
parent e4684220af
commit ff111ea5e3
2 changed files with 21 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# Make ALTER TYPE with SERIAL make sense.
table = strip_quotes(model._meta.db_table)
if new_type.lower() in ("serial", "bigserial"):
column = new_field.column
column = strip_quotes(new_field.column)
sequence_name = "%s_%s_seq" % (table, column)
col_type = "integer" if new_type.lower() == "serial" else "bigint"
return (