diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py index c51b357bec..3c0924e53f 100644 --- a/django/core/db/backends/mysql.py +++ b/django/core/db/backends/mysql.py @@ -95,6 +95,7 @@ DATA_TYPES = { 'IPAddressField': 'char(15)', 'ManyToManyField': None, 'NullBooleanField': 'bool', + 'OneToOneField': 'integer', 'PhoneNumberField': 'varchar(20)', 'PositiveIntegerField': 'integer UNSIGNED', 'PositiveSmallIntegerField': 'smallint UNSIGNED', diff --git a/django/core/db/backends/postgresql.py b/django/core/db/backends/postgresql.py index 8de25f0d57..ded611376d 100644 --- a/django/core/db/backends/postgresql.py +++ b/django/core/db/backends/postgresql.py @@ -105,6 +105,7 @@ DATA_TYPES = { 'IPAddressField': 'inet', 'ManyToManyField': None, 'NullBooleanField': 'boolean', + 'OneToOneField': 'integer', 'PhoneNumberField': 'varchar(20)', 'PositiveIntegerField': 'integer CHECK (%(name)s >= 0)', 'PositiveSmallIntegerField': 'smallint CHECK (%(name)s >= 0)',