managarten/services/mana-core-auth/src/db
Wuesteon 7f3575387c 🐛 fix(auth-migrations): make initial migration idempotent
The migration was failing on staging because the auth schema already
existed from previous db:push operations. This fix makes all DDL
statements idempotent:

- CREATE SCHEMA IF NOT EXISTS for all schemas
- DO $$ BEGIN ... EXCEPTION WHEN duplicate_object ... END $$ for ENUMs
- CREATE TABLE IF NOT EXISTS for all tables
- CREATE INDEX IF NOT EXISTS for all indexes
- DO $$ BEGIN ... EXCEPTION WHEN duplicate_object ... END $$ for constraints

This ensures migrations can run safely against databases that already
have the schema partially or fully created.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 22:10:00 +01:00
..
migrations 🐛 fix(auth-migrations): make initial migration idempotent 2025-12-18 22:10:00 +01:00
schema 🔒 security(auth): migrate to EdDSA JWT and add automated monitoring 2025-12-18 21:42:47 +01:00
connection.ts style: auto-format codebase with Prettier 2025-11-27 18:33:16 +01:00
migrate.ts feat(db): add production-safe migration system with advisory locks 2025-12-09 02:13:11 +01:00