Django переходит с sqlite3 на mysql

Я пытаюсь перевести свое приложение Django с SQLite3 на MySql. Я предпринял следующие шаги

  1. Configured a new empty database on MySql. I did not create any tables because I assumed that the tables will be created by the migrate command.
  2. Created a new user who has access to this database CREATE USER 'djangouser'@'%' IDENTIFIED WITH mysql_native_password BY 'password';GRANT ALL ON djangoappdb.* TO 'djangouser'@'%';
  3. Stopped the server
  4. Dumped all the data to a file using python3 manage.py dumpdata > currData
  5. Deleted all the existing migrations
  6. reran python3 manage.py makemigrations. This step created a single new migration file
  7. Changed the setting.py file to use MySql and djangoappdb with correct username and password.
  8. ran python3 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 является одной из моделей в приложении. Должен ли я создавать таблицы вручную?

Вернуться на верх