feat(migrations): remove push:true, run migrations automatically on deploy
- 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:
parent
1c08076963
commit
c707a70065
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ export default buildConfig({
|
|||
pool: {
|
||||
connectionString: process.env['DATABASE_URL']!,
|
||||
},
|
||||
push: true,
|
||||
migrationDir: path.resolve(dirname, 'migrations'),
|
||||
}),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue