Create database migration
About
This skill helps developers create database migrations for Ghost's MySQL schema, such as adding tables or columns. It generates the initial migration file using the `slimer` CLI tool and guides updating it with proper utility functions. Use it when you need to modify the Ghost database structure in a version-controlled way.
Quick Install
Claude Code
Recommended/plugin add https://github.com/majiayu000/claude-skill-registrygit clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/Create database migrationCopy and paste this command in Claude Code to install this skill
Documentation
Create Database Migration
Instructions
- Change directories into
ghost/core:cd ghost/core - Create a new, empty migration file using slimer:
slimer migration <name-of-database-migration>. IMPORTANT: do not create the migration file manually; always use slimer to create the initial empty migration file. - The above command will create a new directory in
ghost/core/core/server/data/migrations/versionsif needed, and create the empty migration file with the appropriate name. - Update the migration file with the changes you want to make in the database, following the existing patterns in the codebase. Where appropriate, prefer to use the utility functions in
ghost/core/core/server/data/migrations/utils/*. - Update the schema definition file in
ghost/core/core/server/data/schema/schema.js, and make sure it aligns with the latest changes from the migration. - Test the migration manually:
yarn knex-migrator migrate --v {version directory} --force - If adding or dropping a table, update
ghost/core/core/server/data/exporter/table-lists.jsas appropriate. - Run the schema integrity test, and update the hash:
yarn test:single test/unit/server/data/schema/integrity.test.js - Run unit tests in Ghost core, and iterate until they pass:
cd ghost/core && yarn test:unit
Examples
See examples.md for example migrations.
Rules
See rules.md for rules that should always be followed when creating database migrations.
GitHub Repository
Related Skills
content-collections
MetaThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
llamaindex
MetaLlamaIndex is a data framework for building RAG-powered LLM applications, specializing in document ingestion, indexing, and querying. It provides key features like vector indices, query engines, and agents, and supports over 300 data connectors. Use it for document Q&A, chatbots, and knowledge retrieval when building data-centric applications.
hybrid-cloud-networking
MetaThis skill configures secure hybrid cloud networking between on-premises infrastructure and cloud platforms like AWS, Azure, and GCP. Use it when connecting data centers to the cloud, building hybrid architectures, or implementing secure cross-premises connectivity. It supports key capabilities such as VPNs and dedicated connections like AWS Direct Connect for high-performance, reliable setups.
polymarket
MetaThis skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
