fix: error on postgresql 14 due to BIGSERIAL (#38040)
This pull request makes a targeted update to how PostgreSQL database types are specified in the courseware/fields.py file. Specifically, it changes the type returned for PostgreSQL from BIGSERIAL to BIGINT in both the db_type and rel_db_type methods. This ensures that auto-incrementing behavior is not implicitly assumed and aligns with scenarios where a plain integer type is needed.
This commit is contained in:
committed by
GitHub
parent
12a46e6463
commit
68a53b8506
@@ -21,7 +21,7 @@ class UnsignedBigIntAutoField(AutoField):
|
||||
elif "postgresql" in connection.settings_dict['ENGINE']:
|
||||
# Pg's bigserial is implicitly unsigned (doesn't allow negative numbers) and
|
||||
# goes 1-9.2x10^18
|
||||
return "BIGSERIAL"
|
||||
return "BIGINT"
|
||||
else:
|
||||
return None
|
||||
|
||||
@@ -31,6 +31,6 @@ class UnsignedBigIntAutoField(AutoField):
|
||||
elif connection.settings_dict['ENGINE'] == 'django.db.backends.sqlite3':
|
||||
return "integer"
|
||||
elif "postgresql" in connection.settings_dict['ENGINE']:
|
||||
return "BIGSERIAL"
|
||||
return "BIGINT"
|
||||
else:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user