Create database migration

Generate and apply Ghost CMS database migrations using slimer and knex-migrator.

27|10|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/nilecui/SkillsBase --skill create-database-migration-nilecui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Create database migration
Source: https://github.com/nilecui/SkillsBase/tree/main/.cursor/skills/create-database-migration
Command: npx skills add https://github.com/nilecui/SkillsBase --skill create-database-migration-nilecui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of modifying the Ghost CMS database schema by providing a structured and safe way to create and apply migrations.

Core Features & Use Cases

  • Automated Migration Generation: Creates new, empty migration files using the slimer tool, ensuring proper naming conventions and file structure.
  • Schema Definition Updates: Guides users to update the central schema definition file (schema.js) to reflect database changes.
  • Data Manipulation: Supports adding tables, columns, settings, and manipulating existing data within migrations.
  • Testing & Validation: Includes steps for manual migration testing and running schema integrity tests.
  • Use Case: When adding a new feature to Ghost that requires a new database table, use this Skill to generate the migration file, define the table schema, and ensure all tests pass before merging.

Quick Start

Use the create-database-migration skill to generate a new migration file for adding a 'tags' table to the Ghost database.

Frequently Asked Questions about Create database migration

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

FAQPage Schema
How do I create a database migration for Ghost CMS?

To create a Ghost CMS database migration, this Skill uses the `slimer` tool to generate a new, empty migration file with proper naming conventions, then guides you through updating the central `schema.js` definition file to reflect the changes before applying them.

What is the process for adding a new table to the Ghost database schema?

Adding a table to the Ghost database schema involves generating a migration file, updating the schema definition in `schema.js` to include the new table structure, and running schema integrity tests to ensure the changes apply correctly.

How does knex-migrator apply schema changes in Ghost?

`knex-migrator` executes the generated database migration files to apply schema changes to the Ghost CMS database, handling the actual data manipulation and structural updates defined during the migration creation workflow.

Do I need to update schema.js manually when adding columns to Ghost?

Yes, you must manually update the central `schema.js` definition file to reflect any new columns or settings added to the Ghost database, ensuring the schema definition stays synchronized with your migration file changes.

Can I test database migrations manually before merging Ghost CMS changes?

Yes, this Skill includes steps for manual migration testing and running schema integrity tests, allowing you to validate that adding tables, columns, and settings works correctly before merging the Ghost CMS changes.

What are the limitations of using slimer for Ghost database migrations?

Using `slimer` for Ghost database migrations is limited to generating empty migration files with correct structure; it does not automatically define the schema logic, meaning you must manually implement the table definitions and data manipulation steps.