Reputation: 362
I am trying to migrate my Django app from SQLite3 to MySql. I took following steps
CREATE USER 'djangouser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';GRANT ALL ON djangoappdb.* TO 'djangouser'@'%';
python3 manage.py dumpdata > currData
python3 manage.py makemigrations
. This step created a single new migration filepython3 manage.py migrate
command. I get following error...
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1146, "Table 'djangoappdb.djangoapp_customuser' doesn't exist")
customuser is one of the models in the app. Am I supposed to create the tables manually?
EDIT2 Here is the customuser model in case it is requested
from django.contrib.auth.models import AbstractUser, Group
# CustomUser:
class CustomUser(AbstractUser):
pass
# add additional fields later
def __str__(self):
return self.username
Upvotes: 0
Views: 528