cms.c2sgmbh/drizzle.production.config.ts
Martin Porwoll 9e433315e5 feat: add automatic schema sync to deployment workflow
- Add drizzle.production.config.ts for schema synchronization
- Add scripts/sync-schema.sh for manual schema sync
- Update deploy-production.sh to run drizzle-kit push after migrations
- Document schema sync workflow in DEPLOYMENT_STRATEGY.md
- Update CLAUDE.md with schema sync commands

This prevents schema drift between DEV and PROD by automatically
syncing the database schema (especially payload_locked_documents_rels)
during deployment.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:17:47 +00:00

20 lines
559 B
TypeScript

import { defineConfig } from 'drizzle-kit'
/**
* Drizzle config for production schema sync.
* Used by deploy script to push schema changes directly to database.
*
* Usage:
* DATABASE_URI="postgresql://..." pnpm exec drizzle-kit push --config=drizzle.production.config.ts
*/
export default defineConfig({
schema: './src/payload-generated-schema.ts',
out: './drizzle',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URI || '',
},
// Safe mode - will prompt for destructive changes
strict: true,
verbose: true,
})