Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: flask db downgrade not work (#29465)

非法操作fcadee9413a9
diff --git a/api/migrations/versions/2025_11_15_2102-09cfdda155d1_mysql_adaptation.py b/api/migrations/versions/2025_11_15_2102-09cfdda155d1_mysql_adaptation.py
index a3f6c3cb192..877fa2f3092 100644
--- a/api/migrations/versions/2025_11_15_2102-09cfdda155d1_mysql_adaptation.py
+++ b/api/migrations/versions/2025_11_15_2102-09cfdda155d1_mysql_adaptation.py
@@ -1,4 +1,4 @@
-"""empty message
+"""mysql adaptation
Revision ID: 09cfdda155d1
Revises: 669ffd70119c
@@ -97,11 +97,31 @@ def downgrade():
batch_op.alter_column('include_plugins',
existing_type=sa.JSON(),
type_=postgresql.ARRAY(sa.VARCHAR(length=255)),
- existing_nullable=False)
+ existing_nullable=False,
+ postgresql_using="""
+ COALESCE(
+ regexp_replace(
+ replace(replace(include_plugins::text, '[', '{'), ']', '}'),
+ '"',
+ '',
+ 'g'
+ )::varchar(255)[],
+ ARRAY[]::varchar(255)[]
+ )""")
batch_op.alter_column('exclude_plugins',
existing_type=sa.JSON(),
type_=postgresql.ARRAY(sa.VARCHAR(length=255)),
- existing_nullable=False)
+ existing_nullable=False,
+ postgresql_using="""
+ COALESCE(
+ regexp_replace(
+ replace(replace(exclude_plugins::text, '[', '{'), ']', '}'),
+ '"',
+ '',
+ 'g'
+ )::varchar(255)[],
+ ARRAY[]::varchar(255)[]
+ )""")
with op.batch_alter_table('external_knowledge_bindings', schema=None) as batch_op:
batch_op.alter_column('external_knowledge_id',