From 0c763c60241f944529a716bc1915fa25eac536c8 Mon Sep 17 00:00:00 2001 From: long2ice Date: Wed, 9 Jun 2021 13:56:25 +0800 Subject: [PATCH] Fix repeat --- aerich/migrate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aerich/migrate.py b/aerich/migrate.py index 9d20852..018df4e 100644 --- a/aerich/migrate.py +++ b/aerich/migrate.py @@ -377,6 +377,9 @@ class Migrate: cls._add_operator( cls._drop_index(model, (field_name,), unique), upgrade, True ) + elif option == "db_field_types.": + # continue since repeated with others + continue elif option == "default": if not ( is_default_function(old_new[0]) or is_default_function(old_new[1]) @@ -385,6 +388,9 @@ class Migrate: cls._add_operator( cls._alter_default(model, new_data_field), upgrade ) + elif option == "unique": + # because indexed include it + continue elif option == "nullable": # change nullable cls._add_operator(cls._alter_null(model, new_data_field), upgrade)