Add a rel_db_type to UnsignedBigIntAutoField

This commit is contained in:
Tyler Hallada
2017-07-31 11:22:56 -04:00
parent 26fcbefee1
commit 6b97c1bdcb

View File

@@ -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