From 68a53b85067e49e1f9feb7be12dc90ab74cd4dc3 Mon Sep 17 00:00:00 2001 From: Muhammad Qasim Gulzar <19186089+qasimgulzar@users.noreply.github.com> Date: Sun, 8 Mar 2026 06:12:57 +0500 Subject: [PATCH] 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. --- lms/djangoapps/courseware/fields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/courseware/fields.py b/lms/djangoapps/courseware/fields.py index 0ee7fad62f..a44c9791b8 100644 --- a/lms/djangoapps/courseware/fields.py +++ b/lms/djangoapps/courseware/fields.py @@ -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