feat(migrations): remove push:true, run migrations automatically on deploy
Some checks are pending
CI / Type Check (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Unit Tests (push) Waiting to run
Deploy / Build & Push Image (push) Waiting to run
Deploy / Deploy to VPS (push) Blocked by required conditions

- Remove push:true from postgres adapter (unreliable for new columns)
- Remove profile:tools from migrate service so it runs on every deploy
- Add restart:no to migrate service (one-shot runner)
- App now depends on migrate with service_completed_successfully condition:
  postgres healthy → migrate applies pending → app starts

Workflow for future schema changes:
  1. Add field to collection/global TypeScript
  2. ssh server: docker-compose run --rm migrate migrate:create --name <field>
  3. git pull the generated .ts migration file
  4. commit + push → next deploy applies it automatically

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-05-13 19:11:50 +01:00
parent 1c08076963
commit c707a70065
2 changed files with 3 additions and 3 deletions

View file

@ -30,8 +30,7 @@ services:
- ./migrations:/app/migrations
networks:
- internal
profiles:
- tools
restart: "no"
app:
build: .
@ -40,6 +39,8 @@ services:
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
volumes:
- media_uploads:/app/media
restart: unless-stopped

View file

@ -48,7 +48,6 @@ export default buildConfig({
pool: {
connectionString: process.env['DATABASE_URL']!,
},
push: true,
migrationDir: path.resolve(dirname, 'migrations'),
}),