packServer/backend/package.json
liufumingren 413bd9f981 chore(db): 新增 npm run db:deploy,部署时一次执行全部库结构变更
- scripts/db-deploy.js:建库(有权限时) → 基线表 sql/schema.sql → 全部未执行的 database/migrations,
  幂等可重复执行;--check 只列出待执行迁移(有 pending 时退出码 1),便于上线前/CI 卡一道
- 保留仓库内所有迁移脚本:sql/migrations 历史补丁、database/migrations、一次性数据脚本都不删不改,
  顺序与用途写进 README「部署 / 升级(库结构)」

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-20 21:26:30 +08:00

49 lines
1.4 KiB
JSON
Raw 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.

{
"name": "pack-service",
"version": "1.0.0",
"description": "Egg.js 接口服务(MySQL + Redis)",
"private": true,
"egg": {
"declarations": true
},
"dependencies": {
"bcryptjs": "^3.0.3",
"egg": "^3.34.0",
"egg-redis": "^2.6.1",
"egg-scripts": "^3.1.0",
"egg-sequelize": "^6.0.0",
"http-proxy": "^1.18.1",
"jsonwebtoken": "^9.0.3",
"koa-static": "^5.0.0",
"mysql2": "^3.24.6",
"nodemailer": "^10.1.2",
"qrcode-generator": "^2.0.4",
"sequelize": "^6.37.8"
},
"devDependencies": {
"egg-bin": "^6.13.0",
"egg-mock": "^5.15.2",
"sequelize-cli": "^6.6.5"
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"start": "egg-scripts start --daemon --title=egg-server-pack-service",
"stop": "egg-scripts stop --title=egg-server-pack-service",
"dev": "egg-bin dev",
"debug": "egg-bin debug",
"test": "egg-bin test",
"cov": "egg-bin cov",
"db:init": "node scripts/init-db.js",
"db:deploy": "node scripts/db-deploy.js",
"db:migrate": "sequelize-cli db:migrate",
"db:migrate:undo": "sequelize-cli db:migrate:undo",
"db:migrate:status": "sequelize-cli db:migrate:status",
"db:migration:generate": "sequelize-cli migration:generate --name",
"user:pass": "node scripts/set-password.js",
"backfill:snapshot": "node scripts/backfill-snapshot.js",
"records:dedupe": "node scripts/dedupe-scan-records.js"
}
}