6 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 04f1801b89 fix(entrypoint): let 0001 migration run so rethus columns are created on deploy
Baselining 0001 caused rethus_code/rethus_validated to never be added
automatically. The SQL already uses IF NOT EXISTS so it is safe to deploy
on every fresh container even if the columns already exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:34:46 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 57c159e91f fix(migrations): baseline existing tables + add 0003 for missing suggestions table
- entrypoint.sh: resolve --applied 0000 and 0001 before deploying,
  so prisma skips them and only runs 0002 (message_logs) and 0003 (suggestions)
- migration 0003: CREATE TABLE IF NOT EXISTS suggestions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:17:08 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 9703b1f08e fix(db): use postgres container name as host instead of IP, fix space in user
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:10:27 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 54bc39bb34 fix(config): hardcode DATABASE_URL in entrypoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:28:28 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 e9e3d8141d fix(entrypoint): remove set -e, add verbose logging, don't block on migration failure
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:24:57 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 1e63ed1873 feat(db): idempotent migrations + auto-deploy on startup
- Rewrite 0000_init with IF NOT EXISTS on all tables, indexes and enums;
  wrap FK constraints in DO/EXCEPTION blocks so re-runs never fail
- Add missing suggestions table to init migration
- Add migration 0002 to create message_logs table (IF NOT EXISTS)
- Add entrypoint.sh: runs prisma migrate deploy before starting the server
- Update Dockerfile to copy entrypoint.sh and use it as CMD
- Add prisma:migrate script to package.json for manual runs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:10:33 -05:00