41d4465905
Adds backend/src/db/migrations-runner.js: - Tracks applied migrations in _migrations table - Applies .sql files from src/db/migrations/ in alphabetical order - Each file runs in a transaction — fail-fast, no partial state - `migrate:bootstrap` marks 000_baseline.sql as applied on existing DBs 000_baseline.sql — full schema snapshot from prod DB (168 objects, 2026-05-06). Removed stale PostgreSQL migration files (001_init.sql, 002_constraints.sql) that used SERIAL/EXTENSION syntax incompatible with SQLite. npm scripts: migrate → migrations-runner.js (versioned) migrate:bootstrap → mark baseline applied (run once per env) migrate:legacy → legacy migrate.js (kept for reference) On prod DB after `migrate:bootstrap`: "Nothing to apply — schema is up to date". Legacy migrate.js still in place; tests still use it via setup.js (unchanged). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
959 B
JSON
34 lines
959 B
JSON
{
|
|
"name": "learnspace-backend",
|
|
"version": "1.0.0",
|
|
"description": "LearnSpace backend",
|
|
"main": "src/server.js",
|
|
"scripts": {
|
|
"start": "node src/server.js",
|
|
"dev": "nodemon src/server.js",
|
|
"migrate": "node src/db/migrations-runner.js",
|
|
"migrate:bootstrap": "node src/db/migrations-runner.js bootstrap",
|
|
"migrate:legacy": "node src/db/migrate.js",
|
|
"seed": "node src/db/seed.js",
|
|
"seed:permissions": "node src/db/seed-permissions.js",
|
|
"lint:routes": "node scripts/check-route-auth.js",
|
|
"import:content": "node scripts/import-content.js",
|
|
"test": "node --test tests/*.test.js"
|
|
},
|
|
"dependencies": {
|
|
"bcryptjs": "^2.4.3",
|
|
"compression": "^1.8.1",
|
|
"cors": "^2.8.5",
|
|
"dotenv": "^16.4.5",
|
|
"express": "^4.18.3",
|
|
"js-yaml": "^4.1.1",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"multer": "^2.1.1",
|
|
"sharp": "^0.34.5",
|
|
"ws": "^8.20.0"
|
|
},
|
|
"devDependencies": {
|
|
"nodemon": "^3.1.0"
|
|
}
|
|
}
|