Open vlakius opened 2 years ago
Did you run aerich upgrade prior to making the on_delete
code change and then run aerich migrate?
Did you run aerich upgrade prior to making the
on_delete
code change and then run aerich migrate?
no, but I just tried and it keeps giving me "no changes detected".
also if I try to delete null=True
and change the field on_delete=fields.CASCADE
doing aerich migrate the change is detected but the _update.sql file shows no operation on contraints
-- upgrade --
ALTER TABLE `intervents` MODIFY COLUMN `client_id` INT NOT NULL ';
-- downgrade --
ALTER TABLE `intervents` MODIFY COLUMN `client_id` INT
Fairly certain the fields.RESTRICT
is a code level concept (similar to default=
field arg in sqlalchemy) and at the database level it's just a non-nullable column that has a foreign key which would be managed by mysql itself.
I have already initialized the database with aerich init-db etc.. and the migration works correctly except when I try to change foreign key properties my models (simplified)
I try to change the constraints to
on_delete=fields.RESTRINCT
But when I try to do aerich migrate it tells me
no changes detected
As ORM I am using Tortoise ORM and the database is MYSQL Am I missing something ?