I'm working on a project that requires us to turn in mysql scripts of our database. Is there a way to tell Django to make MySql migrations instead of SqLite migrations, without configuring/connecting to a mysql server?
Asked
Active
Viewed 500 times
1 Answers
2
The migrations created by the makemigrations
command are database agnostic, they can be run on any database.
You can use the sqlmigrate
to show the SQL for a given migration. To generate SQL for MySQL, you would have to to add a MySQL database to your DATABASES
setting. From a quick test, it looks like Django tries to connect to the MySQL server when you run the showmigrations
. Therefore I don't think it will be possible to avoid configuring settings with a MySQL server, without diving deep into the Django internals.

Alasdair
- 298,606
- 55
- 578
- 516