revert(db): remove Alembic migration system

Remove Alembic database migration system in favor of delta scripts:

Deleted:
- runtime/datamate-python/alembic.ini (config file)
- runtime/datamate-python/alembic/env.py (environment config)
- runtime/datamate-python/alembic/script.py.mako (migration template)
- runtime/datamate-python/alembic/versions/20250205_0001_add_file_version.py (migration)

Modified:
- scripts/db/data-annotation-init.sql
  - Removed alembic_version table creation and version insertion
  - Kept file_version column in t_dm_annotation_results

Rationale:
- Alembic migration testing failed in production
- Delta scripts are simpler and more reliable for this project
- SQL init scripts contain complete schema including latest changes
This commit is contained in:
2026-02-06 13:29:44 +08:00
parent f8f9faaa06
commit fbc83b5610
5 changed files with 0 additions and 231 deletions

View File

@@ -1467,22 +1467,6 @@ INSERT INTO t_dm_annotation_templates (
'1.0.0'
);
-- =============================================
-- Alembic 版本控制表(标记数据库已应用最新迁移)
-- 说明:如果使用此脚本初始化数据库,则不需要再运行 Alembic 升级
-- =============================================
-- 创建 alembic_version 表(如果不存在)
CREATE TABLE IF NOT EXISTS alembic_version (
version_num VARCHAR(32) NOT NULL PRIMARY KEY
) COMMENT='Alembic 迁移版本记录表';
-- 清除现有版本记录(避免重复插入错误)
DELETE FROM alembic_version;
-- 插入当前最新版本(与 alembic/versions/20250205_0001_add_file_version.py 对应)
INSERT INTO alembic_version (version_num) VALUES ('20250205_0001');
-- =============================================
-- 完成提示
-- =============================================