🐛 fix(ci): use db:migrate instead of db:push for test databases

Critical fix based on test failure analysis:
- E2E tests need real migration SQL files to create tables
- db:push is for development schema sync only
- db:migrate runs tracked migrations with advisory locks

This fixes errors:
- relation "credits.balances" does not exist
- relation "referrals.codes" does not exist
- relation "auth.security_events" does not exist

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Wuesteon 2025-12-25 20:44:38 +01:00
parent dfdd04593c
commit 2186cb3518

View file

@ -93,8 +93,7 @@ jobs:
working-directory: services/mana-core-auth
env:
DATABASE_URL: postgresql://manacore:testpassword@localhost:5432/manacore
run: |
pnpm run db:push || echo "No migrations to run"
run: pnpm run db:migrate
- name: Run tests with coverage
working-directory: services/mana-core-auth
@ -184,13 +183,10 @@ jobs:
run: pnpm run build:packages
- name: Setup databases for integration tests
working-directory: services/mana-core-auth
env:
DATABASE_URL: postgresql://manacore:testpassword@localhost:5432/manacore
run: |
# Setup auth database
cd services/mana-core-auth
pnpm run db:push || echo "Auth DB setup skipped"
cd ../..
run: pnpm run db:migrate
- name: Run integration tests
env: