Skip to content

Conversation

@waketzheng
Copy link
Contributor

Action https://github.com/tortoise/aerich/actions/runs/12142921728/job/33858554690 failed with the following info:

>           assert Migrate.upgrade_operators == []
E           assert ['ALTER TABLE...itle_f7fc03"'] == []
E             
E             Left contains one more item: 'ALTER TABLE "category" DROP INDEX "uid_category_title_f7fc03"'
E             
E             Full diff:
E             - []
E             + [
E             +     'ALTER TABLE "category" DROP INDEX "uid_category_title_f7fc03"',
E             + ]

tests/test_migrate.py:1038: AssertionError
=========================== short test summary info ============================
FAILED tests/test_migrate.py::test_migrate - assert ['ALTER TABLE...itle_f7fc03"'] == []
  
  Left contains one more item: 'ALTER TABLE "category" DROP INDEX "uid_category_title_f7fc03"'
  
  Full diff:
  - []
  + [
  +     'ALTER TABLE "category" DROP INDEX "uid_category_title_f7fc03"',
  + ]
========================= 1 failed, 15 passed in 0.25s =========================
make: *** [Makefile:36: test_sqlite] Error 1

That is because the ALTER operator add to class var of Migrate before NotSupportError raised.

Resolve it by move the Migrate._merge_operators() to only run in case of ddl is not sqlite.

@waketzheng waketzheng merged commit ac3ef9e into tortoise:dev Dec 3, 2024
5 checks passed
@waketzheng waketzheng deleted the fix-ci-error branch December 22, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant