diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34b8d8b..ab786d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,6 @@ jobs: with: node-version-file: ".nvmrc" - run: npm ci - - run: npm run db:generate - run: npm run db:migrate - run: npm test -- --disable-coverage @@ -149,9 +148,7 @@ jobs: node-version-file: ".nvmrc" - run: npm ci - run: npx playwright install chromium-headless-shell - - run: npm run db:generate - run: npm run db:migrate - - run: node scripts/migrate.js - run: | node src/index.js > server.log 2>&1 & for i in {1..30}; do diff --git a/AGENTS.md b/AGENTS.md index 4c4a71e..7f6da9c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,7 +32,6 @@ Authentication/profile prototype for Codebar using [Better Auth](https://www.bet 3. For new setup: ```sh npm ci - npm run db:generate npm run db:migrate npm run dev ``` @@ -56,11 +55,10 @@ See [docs/heroku-setup.md](docs/heroku-setup.md) for initial Heroku setup and [d **Database:** -- `npm run db:generate` - Generate Better Auth database schema -- `npm run db:migrate` - Run database migrations -- `rm auth.db` - Delete local database to start fresh +- `npm run db:migrate` - Run database migrations and seed the planner OAuth client +- `scripts/container.sh destroy` - Delete the local Postgres container and its data to start fresh -**Local development uses SQLite** (`./auth.db` file). No database server needed. +**Local development and tests use a Postgres container** (`scripts/container.sh`, port 5433, started by `npm run dev` and `pretest`). **CI and production use PostgreSQL** (configured via `DATABASE_URL` environment variable). **Code quality:** diff --git a/README.md b/README.md index 2f1b4ed..fbb716e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ For a new run the following: ```sh npm ci -npm run db:generate npm run db:migrate npm run dev ``` diff --git a/package.json b/package.json index c975481..f25738b 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ }, "scripts": { "dev": "scripts/container.sh ensure && node --watch src/index.js", - "db:generate": "npx @better-auth/cli generate --yes", - "db:migrate": "npx @better-auth/cli migrate --yes", + "db:migrate": "scripts/container.sh ensure && node scripts/migrate.js", "fallow": "fallow", "prettier:check": "prettier --check '**/*.{js,css,md,yml}'", "prettier:write": "prettier --write '**/*.{js,css,md,yml}'",