Files
MonkeyCode/backend/migration/000010_alter_task_table.up.sql
AlanAlanAlanXu e470f43fbe 增加一键dump补全数据api
update migration
2025-07-22 17:54:28 +08:00

11 lines
394 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 添加prompt字段如果不存在
ALTER TABLE tasks ADD COLUMN IF NOT EXISTS prompt text;
-- 修改cursor_position为JSON类型如果还是bigint类型
ALTER TABLE tasks ALTER COLUMN cursor_position TYPE jsonb USING
CASE
WHEN cursor_position IS NOT NULL THEN
jsonb_build_object('position', cursor_position, 'line', 1, 'column', cursor_position)
ELSE NULL
END;