[modify] migration script

This commit is contained in:
Mark
2026-04-28 13:44:05 +08:00
parent d85a1cb131
commit 9598bd5905

View File

@@ -28,6 +28,11 @@ def upgrade() -> None:
existing_comment="模型能力列表(如['vision', 'audio', 'video']",
existing_nullable=False)
# ### end Alembic commands ###
op.execute("""
UPDATE files
SET file_key = 'kb/' || kb_id::text || '/' || parent_id::text || '/' || id::text || file_ext
WHERE file_ext != 'folder' AND file_key IS NULL
""")
def downgrade() -> None: