Skip to content

fix: 重写 b1d72ad8a6ed migration - SQLite 兼容版本#7

Merged
Color2333 merged 2 commits intomainfrom
dev
Mar 20, 2026
Merged

fix: 重写 b1d72ad8a6ed migration - SQLite 兼容版本#7
Color2333 merged 2 commits intomainfrom
dev

Conversation

@Color2333
Copy link
Copy Markdown
Owner

Summary

  • 重写 b1d72ad8a6ed migration,移除 SQLite 不支持的 ALTER TABLE 操作
  • 改为纯 CREATE TABLE IF NOT EXISTS(幂等),兼容 SQLite
  • 删除 down_revision 中的 sqlite.JSON() 等 PostgreSQL 类型引用

问题

原 migration 在 alembic upgrade 时失败:

  • ALTER TABLE action_papers ALTER COLUMN id SET NOT NULL — SQLite 不支持
  • sqlite.JSON() — PostgreSQL 类型,SQLite 不存在
  • drop_constraint(None, ...) — constraint_name 不能为 None

修复

迁移只创建实际需要的两个表:cs_categoriescs_feed_subscriptions

@github-actions
Copy link
Copy Markdown

🔍 OpenCode PR Review Required

这是一个受保护的分支,merge 前需要进行 code review。

请运行以下命令进行 OpenCode review:

/oc review https://github.com/Color2333/PaperMind/pull/$PR_NUM

或者在 PR 页面评论 /oc 来触发 OpenCode review。


This is an automated reminder from PR Review Gate.

@Color2333 Color2333 merged commit e243901 into main Mar 20, 2026
2 checks passed
@Color2333 Color2333 deleted the dev branch March 20, 2026 03:01
@Color2333 Color2333 restored the dev branch March 20, 2026 03:23
@Color2333 Color2333 deleted the dev branch March 20, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant