mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-04-17 13:21:31 +00:00
feat: add D1 storage layer with per-module migration runner
- SqlStore interface + CF D1 wrapper + per-module factory (table prefix convention)
- init signature extended to ({ db, sql, env }); sql is null when DB binding absent
- custom migration runner walks src/modules/*/migrations/*.sql, tracks applied in _migrations table
- npm run db:migrate with --dry-run and --local flags; chained into deploy
- fake-d1 test helper with subset of SQL semantics for retention and history tests
This commit is contained in:
@@ -9,10 +9,11 @@
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "wrangler dev",
|
||||
"deploy": "wrangler deploy && npm run register",
|
||||
"deploy": "wrangler deploy && npm run db:migrate && npm run register",
|
||||
"db:migrate": "node scripts/migrate.js",
|
||||
"register": "node --env-file=.env.deploy scripts/register.js",
|
||||
"register:dry": "node --env-file=.env.deploy scripts/register.js --dry-run",
|
||||
"lint": "biome check src tests scripts",
|
||||
"lint": "biome check src tests scripts && eslint src",
|
||||
"format": "biome format --write src tests scripts",
|
||||
"test": "vitest run"
|
||||
},
|
||||
@@ -21,6 +22,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.0",
|
||||
"eslint": "^10.2.0",
|
||||
"eslint-plugin-jsdoc": "^62.9.0",
|
||||
"vitest": "^2.1.0",
|
||||
"wrangler": "^3.90.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user