feat: 添加自动迁移脚本并分离评论的slug和URL字段

- 新增自动数据库迁移脚本,在部署前检查并更新schema
- 将post_slug字段拆分为post_slug(仅路径)和post_url(完整URL)
- 更新前端widget以仅使用路径作为post_slug
- 修改部署脚本以在部署前自动运行迁移
This commit is contained in:
anghunk
2026-02-09 12:22:55 +08:00
parent 5cbc012dd3
commit e37a3e79e4
4 changed files with 99 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
"name": "cwd-api",
"version": "0.0.18",
"scripts": {
"deploy": "wrangler deploy",
"deploy": "node scripts/auto_migrate.js && wrangler deploy",
"dev": "wrangler dev",
"start": "wrangler dev",
"test": "vitest",