fix: aerich upgrade raises OperationalError when unique constraint dropped at migration 1_xxx.py with postgres (#383)

This commit is contained in:
Waket Zheng
2024-12-11 15:15:29 +08:00
committed by GitHub
parent 5572876714
commit e4a3863f80
3 changed files with 8 additions and 11 deletions

View File

@@ -174,9 +174,6 @@ def test_drop_index():
if isinstance(Migrate.ddl, MysqlDDL):
assert ret == "ALTER TABLE `category` DROP INDEX `idx_category_name_8b0cb9`"
assert ret_u == "ALTER TABLE `category` DROP INDEX `name`"
elif isinstance(Migrate.ddl, PostgresDDL):
assert ret == 'DROP INDEX "idx_category_name_8b0cb9"'
assert ret_u == 'DROP INDEX "uid_category_name_8b0cb9"'
else:
assert ret == 'DROP INDEX IF EXISTS "idx_category_name_8b0cb9"'
assert ret_u == 'DROP INDEX IF EXISTS "uid_category_name_8b0cb9"'