From 6b97c1bdcb7d7152c7c0a14833caadbf3aa5ad04 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Mon, 31 Jul 2017 11:22:56 -0400 Subject: [PATCH] Add a rel_db_type to UnsignedBigIntAutoField --- lms/djangoapps/coursewarehistoryextended/fields.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lms/djangoapps/coursewarehistoryextended/fields.py b/lms/djangoapps/coursewarehistoryextended/fields.py index a001543d31..795449535a 100644 --- a/lms/djangoapps/coursewarehistoryextended/fields.py +++ b/lms/djangoapps/coursewarehistoryextended/fields.py @@ -23,3 +23,13 @@ class UnsignedBigIntAutoField(AutoField): return "BIGSERIAL" else: return None + + def rel_db_type(self, connection): + if connection.settings_dict['ENGINE'] == 'django.db.backends.mysql': + return "bigint UNSIGNED" + elif connection.settings_dict['ENGINE'] == 'django.db.backends.sqlite3': + return "integer" + elif connection.settings_dict['ENGINE'] == 'django.db.backends.postgresql_psycopg2': + return "BIGSERIAL" + else: + return None