2025-03-17 16:48:29,929 - migration - INFO - 运行迁移，参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:48:29,929 - migration - INFO - 使用已存在的临时配置文件: D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp
2025-03-17 16:48:29,930 - migration - INFO - 命令参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:48:29,930 - migration - INFO - 执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
2025-03-17 16:48:29,930 - migration - INFO - 工作目录: D:\jsw_code\project\tianfeng_task
2025-03-17 16:48:29,930 - migration - INFO - Python 编码: utf-8
2025-03-17 16:48:29,930 - migration - INFO - 文件系统编码: utf-8
2025-03-17 16:48:29,930 - migration - INFO - 系统默认编码: cp936
2025-03-17 16:48:29,930 - migration - INFO - 正在执行迁移，日志将写入 logs\migration_upgrade_20250317.log...
2025-03-17 16:48:30,704 - migration - INFO - 命令执行状态: 成功
2025-03-17 16:48:30,704 - migration - INFO - 输出(最后部分):
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:48:29
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================


2025-03-17 16:50:12,449 - migration - INFO - 运行迁移，参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:50:12,450 - migration - INFO - 使用已存在的临时配置文件: D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp
2025-03-17 16:50:12,450 - migration - INFO - 命令参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:50:12,450 - migration - INFO - 执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
2025-03-17 16:50:12,450 - migration - INFO - 工作目录: D:\jsw_code\project\tianfeng_task
2025-03-17 16:50:12,450 - migration - INFO - Python 编码: utf-8
2025-03-17 16:50:12,450 - migration - INFO - 文件系统编码: utf-8
2025-03-17 16:50:12,450 - migration - INFO - 系统默认编码: cp936
2025-03-17 16:50:12,450 - migration - INFO - 正在执行迁移，日志将写入 logs\migration_upgrade_20250317.log...
2025-03-17 16:50:13,150 - migration - INFO - 命令执行状态: 成功
2025-03-17 16:50:13,150 - migration - INFO - 输出(最后部分):
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:48:29
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:50:12
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================


2025-03-17 16:51:14,892 - migration - INFO - 运行迁移，参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:51:14,892 - migration - INFO - 使用已存在的临时配置文件: D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp
2025-03-17 16:51:14,892 - migration - INFO - 命令参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:51:14,892 - migration - INFO - 执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
2025-03-17 16:51:14,908 - migration - INFO - 工作目录: D:\jsw_code\project\tianfeng_task
2025-03-17 16:51:14,908 - migration - INFO - Python 编码: utf-8
2025-03-17 16:51:14,908 - migration - INFO - 文件系统编码: utf-8
2025-03-17 16:51:14,908 - migration - INFO - 系统默认编码: cp936
2025-03-17 16:51:14,908 - migration - INFO - 正在执行迁移，日志将写入 logs\migration_upgrade_20250317.log...
2025-03-17 16:51:15,435 - migration - INFO - 命令执行状态: 成功
2025-03-17 16:51:15,435 - migration - INFO - 输出(最后部分):
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:48:29
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:50:12
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:51:14
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================


2025-03-17 16:51:54,260 - migration - INFO - 运行迁移，参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:51:54,260 - migration - INFO - 使用已存在的临时配置文件: D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp
2025-03-17 16:51:54,260 - migration - INFO - 命令参数: {'revision': None, 'downgrade': False, 'verbose': False, 'message': None, 'branch': None, 'history': False, 'current': False, 'show': False, 'table': None, 'list_tables': False}
2025-03-17 16:51:54,260 - migration - INFO - 执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
2025-03-17 16:51:54,260 - migration - INFO - 工作目录: D:\jsw_code\project\tianfeng_task
2025-03-17 16:51:54,260 - migration - INFO - Python 编码: utf-8
2025-03-17 16:51:54,260 - migration - INFO - 文件系统编码: utf-8
2025-03-17 16:51:54,260 - migration - INFO - 系统默认编码: cp936
2025-03-17 16:51:54,260 - migration - INFO - 正在执行迁移，日志将写入 logs\migration_upgrade_20250317.log...
2025-03-17 16:51:54,809 - migration - INFO - 命令执行状态: 成功
2025-03-17 16:51:54,809 - migration - INFO - 输出(最后部分):
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:48:29
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:50:12
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:51:14
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.


================================================================================
执行时间: 2025-03-17 16:51:54
执行命令: alembic -c D:\jsw_code\project\tianfeng_task\migrations\alembic.ini.tmp upgrade head
================================================================================


2025-03-17 17:11:12,595 - migration - INFO - 开始执行数据库自动迁移...
2025-03-17 17:11:12,595 - utils.db_migration - INFO - 开始数据库迁移
2025-03-17 17:11:12,657 - utils.db_migration - INFO - 发现 23 个模型
2025-03-17 17:11:12,669 - utils.db_migration - INFO - 表 subtasks 不存在，准备创建
2025-03-17 17:11:12,733 - utils.db_migration - INFO - 创建表 subtasks 成功
2025-03-17 17:11:12,734 - utils.db_migration - INFO - 表 subtask_versions 不存在，准备创建
2025-03-17 17:11:12,785 - utils.db_migration - INFO - 创建表 subtask_versions 成功
2025-03-17 17:11:12,792 - utils.db_migration - INFO - 表 task_flow_connections 不存在，准备创建
2025-03-17 17:11:12,794 - utils.db_migration - ERROR - 创建表 task_flow_connections 失败: (pymysql.err.OperationalError) (1824, "Failed to open the referenced table 'task_flow_nodes'")
[SQL: 
CREATE TABLE task_flow_connections (
	task_id INTEGER NOT NULL COMMENT '任务ID', 
	version_id INTEGER NOT NULL COMMENT '任务版本ID', 
	source_node_id INTEGER NOT NULL COMMENT '源节点ID', 
	target_node_id INTEGER NOT NULL COMMENT '目标节点ID', 
	label VARCHAR(100) COMMENT '连接标签', 
	`condition` VARCHAR(500) COMMENT '连接条件', 
	config JSON COMMENT '连接配置', 
	is_default BOOL COMMENT '是否为默认连接', 
	id INTEGER NOT NULL COMMENT '主键ID' AUTO_INCREMENT, 
	created_at DATETIME COMMENT '创建时间', 
	updated_at DATETIME COMMENT '更新时间', 
	is_deleted BOOL COMMENT '是否删除（软删除标记）', 
	PRIMARY KEY (id), 
	FOREIGN KEY(task_id) REFERENCES tasks (id), 
	FOREIGN KEY(version_id) REFERENCES task_versions (id), 
	FOREIGN KEY(source_node_id) REFERENCES task_flow_nodes (id), 
	FOREIGN KEY(target_node_id) REFERENCES task_flow_nodes (id)
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
2025-03-17 17:11:12,794 - utils.db_migration - INFO - 表 task_flow_nodes 不存在，准备创建
2025-03-17 17:11:12,864 - utils.db_migration - INFO - 创建表 task_flow_nodes 成功
2025-03-17 17:11:12,867 - utils.db_migration - INFO - 表 task_import_exports 不存在，准备创建
2025-03-17 17:11:12,915 - utils.db_migration - INFO - 创建表 task_import_exports 成功
2025-03-17 17:11:12,916 - utils.db_migration - INFO - 表 task_inputs 不存在，准备创建
2025-03-17 17:11:12,968 - utils.db_migration - INFO - 创建表 task_inputs 成功
2025-03-17 17:11:12,969 - utils.db_migration - INFO - 表 task_input_values 不存在，准备创建
2025-03-17 17:11:13,027 - utils.db_migration - INFO - 创建表 task_input_values 成功
2025-03-17 17:11:13,028 - utils.db_migration - INFO - 发现新增列 task_instances.instance_id，准备添加
2025-03-17 17:11:13,029 - utils.db_migration - INFO - 执行SQL: ALTER TABLE task_instances ADD COLUMN instance_id VARCHAR(36) NOT NULL
2025-03-17 17:11:13,061 - utils.db_migration - INFO - 添加列 task_instances.instance_id 成功
2025-03-17 17:11:13,074 - utils.db_migration - INFO - 表 user_operations 不存在，准备创建
2025-03-17 17:11:13,111 - utils.db_migration - INFO - 创建表 user_operations 成功
2025-03-17 17:11:13,111 - utils.db_migration - INFO - 数据库迁移完成
2025-03-17 17:11:13,111 - utils.db_migration - INFO - 数据库迁移成功
2025-03-17 17:11:13,111 - migration - INFO - 数据库迁移成功完成！
2025-03-18 14:25:55,232 - migration - INFO - 开始执行数据库自动迁移...
2025-03-18 14:25:55,232 - utils.db_migration - INFO - 开始数据库迁移
2025-03-18 14:25:55,309 - utils.db_migration - INFO - 发现 22 个模型
2025-03-18 14:25:55,324 - utils.db_migration - INFO - 表 task_flow_connections 不存在，准备创建
2025-03-18 14:25:55,398 - utils.db_migration - INFO - 创建表 task_flow_connections 成功
2025-03-18 14:25:55,403 - utils.db_migration - INFO - 表 task_import_exports 不存在，准备创建
2025-03-18 14:25:55,500 - utils.db_migration - INFO - 创建表 task_import_exports 成功
2025-03-18 14:25:55,503 - utils.db_migration - INFO - 发现新增列 task_input_params.instance_id，准备添加
2025-03-18 14:25:55,503 - utils.db_migration - INFO - 执行SQL: ALTER TABLE task_input_params ADD COLUMN instance_id VARCHAR(36) NOT NULL
2025-03-18 14:25:55,598 - utils.db_migration - INFO - 添加列 task_input_params.instance_id 成功
2025-03-18 14:25:55,611 - utils.db_migration - INFO - 数据库迁移完成
2025-03-18 14:25:55,611 - utils.db_migration - INFO - 数据库迁移成功
2025-03-18 14:25:55,611 - migration - INFO - 数据库迁移成功完成！
