원클릭으로
prisma-cli-migrate-deploy
prisma migrate deploy
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
prisma migrate deploy
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
prisma db execute. Reference when using this Prisma feature.
prisma db pull. Reference when using this Prisma feature.
prisma db push. Reference when using this Prisma feature.
prisma db seed. Reference when using this Prisma feature.
prisma debug. Reference when using this Prisma feature.
prisma dev. Reference when using this Prisma feature.
SOC 직업 분류 기준
| name | prisma-cli-migrate-deploy |
| description | prisma migrate deploy |
| license | MIT |
| metadata | {"author":"prisma","version":"7.0.0"} |
Applies pending migrations in production/staging environments.
prisma migrate deploy
prisma/migrations/_prisma_migrations table| Option | Description |
|---|---|
--schema | Custom path to your Prisma schema |
--config | Custom path to your Prisma config file |
prisma migrate deploy
# GitHub Actions example
- name: Apply migrations
run: npx prisma migrate deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
# Run migrations before starting app
CMD npx prisma migrate deploy && node dist/index.js
| Feature | migrate dev | migrate deploy |
|---|---|---|
| Creates migrations | Yes | No |
| Applies migrations | Yes | Yes |
| Detects drift | Yes | No |
| Prompts for input | Yes | No |
| Uses shadow database | Yes | No |
| Safe for production | No | Yes |
| Resets on issues | Prompts | Fails |
Development: Create migrations locally
prisma migrate dev --name add_feature
Commit: Include migration files in version control
git add prisma/migrations
git commit -m "Add feature migration"
Deploy: Apply in production
prisma migrate deploy
If a migration fails, migrate deploy exits with error. The failed migration is marked as failed in _prisma_migrations.
To fix:
prisma migrate resolve --applied <migration_name>prisma migrate deployprisma migrate status
Shows pending and applied migrations before deploying.
Ensure prisma.config.ts has the production database URL:
import 'dotenv/config'
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
datasource: {
url: env('DATABASE_URL'),
},
})
migrate status before migrate deploy in CImigrate dev in production