fix-migrations

Reset corrupted Drizzle migrations on local PostgreSQL by regenerating and applying a new migration.

130|21|Updated Jun 29, 2023
One-click install
npx skills add https://github.com/indexnetwork/index --skill fix-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-migrations
Source: https://github.com/indexnetwork/index/tree/main/.cursor/skills/fix-migrations
Command: npx skills add https://github.com/indexnetwork/index --skill fix-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill resolves issues with corrupted or broken Drizzle database migrations in a local development environment.

Core Features & Use Cases

  • Resets Database State: Safely reverts the database to a known good state.
  • Preserves Schema: Restores original migration files after applying a clean one.
  • Use Case: When a local database migration fails and leaves the schema in an inconsistent state, this script can be used to reset it to match the current schema definition.

Quick Start

Run the fix-migrations script from the protocol directory.

Frequently Asked Questions about fix-migrations

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

FAQPage Schema
How do I fix corrupted Drizzle migrations on a local PostgreSQL database?

To fix corrupted Drizzle migrations on a local PostgreSQL database, stash your current migration files, generate a new migration that includes the vector extension, apply it to the database, and then restore the original migration files to ensure schema consistency.

What causes Drizzle database migrations to break locally?

Drizzle database migrations break locally when a migration fails and leaves the PostgreSQL schema in an inconsistent state compared to the project's schema definition, requiring a full database reset to resolve.

How do I reset my local database state without losing my Drizzle schema files?

Reset your local database state without losing Drizzle schema files by temporarily stashing the current migration files, applying a clean generated migration, and then restoring the original files to their original location.

Does this Drizzle migration fix script support the vector extension for PostgreSQL?

Yes, the Drizzle migration fix script explicitly supports the PostgreSQL vector extension by generating a new migration that includes the vector extension before applying it to reset the local database.

When should I reset my local PostgreSQL database instead of rolling back migrations?

Reset your local PostgreSQL database instead of rolling back migrations when the schema is left in an inconsistent state that cannot be resolved by standard rollback procedures, ensuring it matches the current schema definition.