squash-table
Squash database table migration versions in server/src/database.ts. Consolidates multiple migrations into a single initial migration while preserving the final schema.
When & Why to Use This Skill
The squash-table skill automates the consolidation of multiple database migration versions into a single, clean initial migration within server/src/database.ts. It preserves the final schema while simplifying the migration history, making it an essential tool for developers looking to maintain a clean codebase during rapid prototyping or before a major release.
Use Cases
- Stabilizing Schema: Merging numerous experimental migrations into a single production-ready baseline after a feature development cycle.
- Codebase Cleanup: Removing redundant migration entries to improve the readability and maintainability of the database configuration file.
- Environment Reset: Simplifying the process of recreating a database from scratch by providing a consolidated, single-step schema definition.
| name | squash-table |
|---|---|
| description | Squash database table migration versions in server/src/database.ts. Consolidates multiple migrations into a single initial migration while preserving the final schema. |
Squash Database Migrations
Purpose
This skill helps consolidate multiple database migrations into a single migration when the schema has stabilized. This is useful during development to clean up migration history.
Target File
server/src/database.ts
How to Use
Tell Claude what changes to make, for example:
- "Squash all migrations into a single initial migration"
- "Combine migrations 1-3 into one"
- "Reset migrations to version 1 with current schema"
What This Skill Does
- Read
server/src/database.tsto understand current migrations and schema - Consolidate schema into a single migration (version 1)
- Update the MIGRATIONS array with the squashed version
Important Notes
- Data Loss Warning: Squashing migrations requires resetting the database
- After squashing, delete the existing database:
rm ~/.config/lingo/data.db - The new single migration will recreate the schema from scratch