Create database migration
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.
More from nilecui/skillsbase
documentation-generation
Create comprehensive technical documentation including API docs, component libraries, README files, architecture diagrams, and developer guides using tools like JSDoc, Storybook, or Docusaurus. Use when documenting APIs, creating component documentation, writing README files, generating API references, documenting architecture decisions, creating onboarding guides, maintaining changelogs, documenting configuration options, or building developer documentation sites.
12rag-implementation
Build Retrieval-Augmented Generation (RAG) systems for LLM applications with vector databases and semantic search. Use when implementing knowledge-grounded AI, building document Q&A systems, or integrating LLMs with external knowledge bases.
10frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
10senior-architect
Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin, Flutter, Postgres, GraphQL, Go, Python. Includes architecture diagram generation, system design patterns, tech stack decision frameworks, and dependency analysis. Use when designing system architecture, making technical decisions, creating architecture diagrams, evaluating trade-offs, or defining integration patterns.
10pdf processing pro
Production-ready PDF processing with forms, tables, OCR, validation, and batch operations. Use when working with complex PDF workflows in production environments, processing large volumes of PDFs, or requiring robust error handling and validation.
9convex-backend
Build real-time, reactive backend applications with Convex using TypeScript queries, mutations, and actions with automatic reactivity and optimistic updates. Use when building real-time collaborative applications, implementing reactive data synchronization, writing serverless backend functions, creating queries that auto-update, implementing mutations with transactional guarantees, handling file uploads with Convex storage, implementing authentication with Convex Auth, designing reactive database schemas, or building applications requiring instant data synchronization.
9