I have three models: assembly, configurator, and genus. I want to move a "genus" foreign key from the assembly model to the configurator model. I moved it in the python code, generated a migration, and but that fails utterly:
django.db.utils.OperationalError: (1025, "Error on rename of './isotek_intranet_django/aion_assembly' to './isotek_intranet_django/#sql2-848-19e5' (errno: 152)")
Which is like useful but not. My backend database is MariaDB. Here is the relevant bits of the migration:
operations = [
migrations.RemoveField(
model_name='assembly',
name='genus',
),
migrations.AddField(
model_name='configurator',
name='genus',
field=models.ForeignKey(default=1, to='aion.Genus'),
),
]
What (and why) am I doing wrong?
Note that I can run my tests just fine. It is updating a currently existing database that fails.
Django is 1.8 release.