database-migration

Manage Prisma database schema and data migrations for the Lucky application.

17|8|Updated Apr 11, 2022
One-click install
npx skills add https://github.com/LucasSantana-Dev/Lucky --skill database-migration-lucassantana-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/LucasSantana-Dev/Lucky/tree/main/.agent-skills/database-migration
Command: npx skills add https://github.com/LucasSantana-Dev/Lucky --skill database-migration-lucassantana-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of managing database schema changes and data migrations, ensuring consistency and preventing data loss during updates.

Core Features & Use Cases

  • Schema Evolution: Safely modify your database schema using Prisma, including adding new models and columns.
  • Migration Execution: Apply database migrations in development and production environments.
  • Use Case: When you need to add a new user_id field to the orders table, this Skill guides you through the necessary Prisma commands to update your schema and apply the migration without downtime.

Quick Start

Use the database-migration skill to apply the latest database migrations to production.

Frequently Asked Questions about database-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage database schema migrations with Prisma?

Database schema migrations with Prisma are managed by modifying the schema file, generating the migration, and applying it to update the database structure safely. This Skill guides you through these commands to ensure consistency and prevent data loss.

How do I apply database migrations in production without downtime?

To apply database migrations in production without downtime, you use safe migration patterns supported by Prisma. This involves deploying schema changes incrementally so the application remains operational during the update process.

What is the best way to add a new column to an existing database schema?

The best way to add a new column to a database schema is updating the Prisma schema definition and generating a migration. This Skill provides the necessary commands to apply the schema modification without causing data loss.

Can I use this database migration process for both development and production environments?

Yes, this database migration process supports both development and production environments. It handles migration application across different environments and manages client regeneration to keep your application in sync.

Why do I need to regenerate the Prisma client after a schema migration?

You need to regenerate the Prisma client after a schema migration to update the client with the latest database structure. This ensures your application code accurately reflects the new models and columns added during the migration.

When should I use a zero-downtime migration pattern for database updates?

You should use a zero-downtime migration pattern for database updates when applying changes to a live production environment. This approach prevents service interruption while schema modifications and data migrations are executed.