fix(ci): migrations idempotentes et deploy prod sans toucher Postgres
Some checks failed
CI / Lint, Test & Build (push) Failing after 5m48s
Deploy to Production / Build and Deploy (push) Has been cancelled

Les migrations échouaient sur une base vide (contraintes/index déjà créés par init).
Le workflow deploy ne recrée plus Postgres ni ne force les entrées _prisma_migrations.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Antigravity
2026-05-17 08:53:29 +00:00
parent bd214f010e
commit b5fb439592
4 changed files with 42 additions and 22 deletions

View File

@@ -121,9 +121,8 @@ jobs:
git fetch origin main
git reset --hard origin/main
echo "=== Pull & recreate postgres with pgvector ==="
docker compose pull postgres
docker compose up -d --force-recreate postgres
echo "=== Ensure postgres is running (no recreate — prod data) ==="
docker compose up -d postgres
echo "=== Waiting for postgres healthy ==="
for i in $(seq 1 30); do
@@ -153,9 +152,6 @@ jobs:
fi
echo "Backup saved: $DUMP_FILE ($(( DUMP_SIZE / 1024 ))KB)"
echo "=== Resolve failed prisma migrations ==="
docker compose exec -T postgres psql -U "${POSTGRES_USER:-memento}" -d "${POSTGRES_DB:-memento}" -c "UPDATE \"_prisma_migrations\" SET \"finished_at\"=NOW(), \"rolled_back_at\"=NULL WHERE \"finished_at\" IS NULL AND \"rolled_back_at\" IS NULL;" || true
echo "=== Building app images ==="
docker compose build memento-note
docker compose build mcp-server