Agent skill · software engineering · n8n-io

n8n:db-migrations

Authors n8n database migrations. Use when creating or modifying files under packages/@n8n/db/src/migrations/, when the user asks to add a column, table, index, foreign key, or backfill, or when the user mentions DB migrations or TypeORM migrations.

Why this skill is useful

Provides specific TypeORM migration patterns and database migration guidelines that the AI wouldn't reliably generate on its own.

What it needs

About 10k tokens when loaded. Last updated 2026-08-07. 199,638 stars on the source repository.

What this skill does

n8n Migration Guidelines Rule of thumb: the @n8n-io/migrations-review team gates every migration PR. The fixes they ask for are predictable — work through the Pre-flight checklist before requesting review. The rest of this document explains the why for each item and covers deeper topics. --- Table of Contents Overview Pre-flight checklist Common Guidance Schema Migrations Data Migrations Cross-database Compatibility Tests General Design Guidance Schema documentation --- Overview Directory Structure Migration Types Interface When to use --- --- ReversibleMigration Schema changes that can be cleanly undone (add/drop column, create/drop table). Requires a working down(). IrreversibleMigration Data transformations, destructive changes, or anything where down() would lose data. No down() allowed. MigrationContext API Source of truth: packages/@n8n/db/src/migrations/migration-types.ts. Check the source for exact signatures when in doubt. DSL Type Mapping Reference Source of truth: packages/@n8n/db/src/migrations/dsl/column.ts. DSL type PostgreSQL SQLite --- --- --- int int integer bigint bigint integer smallint smallint integer varchar(N) varchar(N) varchar(N) (length not enforced) text text text json json text uuid uuid varchar bool boolean boolean double double precision real binary bytea blob timestampTimezone timestamptz datetime timestampNoTimezone timestamp datetime timestamp (deprecated) timestamp datetime Default precision for the timestamp variants is 3 ms; override with .timestampTimezone(6). --- Pre-flight checklist Run through this before requesting review. Each item is a real, recurring reviewer flag; the link points to the section that explains the rule. [ ] Migration was scaffolded with pnpm --filter=@n8n/db migration:new (timestamp + registration are automatic; the migration-timestamp lint rule catches drift). — Creating Migrations [ ] Identifiers go through escape.tableName(...) / escape.columnName(...). Never hand-write n8ntable prefixes. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills n8n-io/db-migrations

View the source on GitHub

Browse the @skills marketplace