You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is ambiguity in the renaming of two columns in the model, the result will be that the migration engine will repeatedly try to do a renaming for each possibility.
for exapmle:
original:
class A(models.Model):
is_active_node = fields.BooleanField(default=True)
is_active_default = fields.BooleanField(default=True)
change to:
class A(models.Model):
is_default_node = fields.BooleanField(default=True)
is_default = fields.BooleanField(default=True)
The migrate will ask you with all the possible rename permutations, a total of 4 times. If you press enter all of them, then migrate will incorrectly generate all cases:
from tortoise import BaseDBAsyncClient
async def upgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "assistant_ais" RENAME COLUMN "is_active_node" TO "is_default_node";
ALTER TABLE "assistant_ais" RENAME COLUMN "is_active_default" TO "is_default_node";
ALTER TABLE "assistant_ais" RENAME COLUMN "is_active_node" TO "is_default";
ALTER TABLE "assistant_ais" RENAME COLUMN "is_active_default" TO "is_default";"""
# and downgrade...
If there is ambiguity in the renaming of two columns in the model, the result will be that the migration engine will repeatedly try to do a renaming for each possibility.
for exapmle:
original:
change to:
The migrate will ask you with all the possible rename permutations, a total of 4 times. If you press enter all of them, then migrate will incorrectly generate all cases:
aerich version: 0.8.1 c2ebe9b
The text was updated successfully, but these errors were encountered: