google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
deploying-production-migrations
Deploy migrations to production safely using migrate deploy in CI/CD. Use when setting up production deployment pipelines.
Full skill instructions
Production database migrations require careful orchestration to prevent data loss and downtime. This covers safe migration deployment using prisma migrate deploy in CI/CD pipelines, failure handling, and rollback strategies.
prisma migrate deploy: Applies pending migrations only; records history in _prisma_migrations; neither creates migrations nor resets database.
npx prisma migrate deploy
prisma migrate dev: Creates migrations, can reset database (development-only)
prisma migrate reset: Drops/recreates database, deletes all data
prisma db push: Bypasses migration history, no rollback capability, risks data loss
# GitHub Actions
name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npx prisma generate
- run: npx prisma migrate deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- run: npm run deploy
# GitLab CI
deploy-production:
stage: deploy
image: node:20
only: [main]
environment:
name: production
before_script:
- npm ci && npx prisma generate
script:
- npx prisma migrate deploy
- npm run deploy
variables:
DATABASE_URL: $DATABASE_URL_PRODUCTION
# Docker
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY prisma ./prisma
RUN npx prisma generate
COPY . .
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
**Check status
**: npx prisma migrate status (identifies pending, applied, failed migrations, and schema drift)
Resolution options:
npx prisma migrate resolve --applied <name> && npx prisma migrate deploynpx prisma migrate resolve --rolled-back <name>npx prisma migrate dev --name fix_previous_migration, then deployManual rollback: Create down migration (SQL to revert changes), apply via npx prisma migrate dev --name rollback_* --create-only
Pre-Deployment: All migrations tested in staging; backup created; rollback plan documented; downtime window scheduled; team notified
Deployment: Maintenance mode enabled (if needed); run npx prisma migrate deploy; verify status; run smoke tests; monitor logs
Post-Deployment: Verify all migrations applied; check functionality; monitor database performance; disable maintenance mode; document issues
Connection pooling: DATABASE_URL="postgresql://user:pass@host:5432/db?connection_limit=10&pool_timeout=20"
Security: Never commit DATABASE_URL; use environment variables, CI/CD secrets, or secret management tools (Vault, AWS Secrets Manager)
Read replicas: Separate migration connection from app connections; migrations always target primary database:
DATABASE_URL="postgresql://primary:5432/db"
DATABASE_URL_REPLICA="postgresql://replica:5432/db"
Expand-Contract Pattern:
ALTER TABLE "User" ADD COLUMN "email_new" TEXT; Deploy app writing to both.WHERE "email_new" IS NULL;3. **Contract** (remove old):ALTER TABLE "User" DROP COLUMN "email"; ALTER TABLE "User" RENAME COLUMN "email_new" TO "email";`
Backwards-compatible: Make columns optional first, enforce constraints in later migration.
Duration tracking: time npx prisma migrate deploy; set alerts for migrations exceeding expected duration
Failure alerts:
- run: npx prisma migrate deploy
- if: failure()
run: curl -X POST $SLACK_WEBHOOK -d '{"text":"Production migration failed!"}'
Schema drift detection: npx prisma migrate status fails if schema differs from migrations
| Issue | Cause | Solution |
|---|---|---|
| Migration hangs | Long-running query, table locks | Identify blocking queries; run during low-traffic window; use SET statement_timeout = '30s'; in PostgreSQL |
| Migration fails midway | Constraint violation, data type mismatch | Check migration status; mark as applied if data correct; create fix migration if needed |
| Out-of-order migrations | Multiple developers creating migrations simultaneously | Merge conflicts in migration files; regenerate if needed; enforce linear history |
Shadow Database (Prisma 6): Not needed for migrate deploy, only migrate dev
DATABASE_URL="postgresql://..."
SHADOW_DATABASE_URL="postgresql://...shadow"
Multi-Environment Strategy:
npx prisma migrate devnpx prisma migrate deploy (test production process)npx prisma migrate deploy (apply only, never create)Prisma Migrate Deploy Documentation | Production Best Practices | Troubleshooting Migrations
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.