Back to Skills

Create database migration

majiayu000
Updated Today
58
9
58
View on GitHub
Metadata

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 CommandRecommended
/plugin add https://github.com/majiayu000/claude-skill-registry
Git CloneAlternative
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/Create database migration

Copy and paste this command in Claude Code to install this skill

Documentation

Create Database Migration

Instructions

  1. Change directories into ghost/core: cd ghost/core
  2. 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.
  3. The above command will create a new directory in ghost/core/core/server/data/migrations/versions if needed, and create the empty migration file with the appropriate name.
  4. 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/*.
  5. 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.
  6. Test the migration manually: yarn knex-migrator migrate --v {version directory} --force
  7. If adding or dropping a table, update ghost/core/core/server/data/exporter/table-lists.js as appropriate.
  8. Run the schema integrity test, and update the hash: yarn test:single test/unit/server/data/schema/integrity.test.js
  9. 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

majiayu000/claude-skill-registry
Path: skills/create-database-migration

Related Skills

content-collections

Meta

This 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.

View skill

llamaindex

Meta

LlamaIndex 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.

View skill

hybrid-cloud-networking

Meta

This 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.

View skill

polymarket

Meta

This 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.

View skill