dify
dify copied to clipboard
fix: in alembic's offline mode (db migrate with --sql option), skip data operations
Description
In some cases where database DDL is limited, SQL operations are controlled independently. Migrations cannot run in the deployment environment, require Alembic generate raw SQL
flask db upgrade --sql
triggered the error.
Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [X] This change requires a documentation update, included: Dify Document Maybe the docs could mention that when deployment migrations don't work, can use Alembic offline mode to get the raw SQL.
How Has This Been Tested?
-
[X] Testing what the --sql parameter does.
-
[X] Testing the migration that's causing the error.
-
[X] Testing the complete migration.
Suggested Checklist:
-
[X] I have performed a self-review of my own code
-
[X] I have commented my code, particularly in hard-to-understand areas
-
[X] My changes generate no new warnings
-
[X] I ran
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint gods -
[ ]
optional
I have made corresponding changes to the documentation -
[ ]
optional
I have added tests that prove my fix is effective or that my feature works -
[ ]
optional
New and existing unit tests pass locally with my changes
Nice feature. Reasonable and practical for enterprise deployment and migration.