nangohq/nango · Archived

creating-database-migrations

Use when adding or editing Nango database migrations - covers migration directory selection, timestamped .cjs naming, matching recent migration style, down migration decisions, and foreign key ON DELETE conventions.

First seen Aug 1, 2026

Installation

$ npx skills add nangohq/nango --skill creating-database-migrations

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from nangohq/nango.

npx skills add nangohq/nango

Browse all from nangohq/nango

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 11.3K
License LICENSE
Default branch master
Open issues 33
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,794 B
  • docs SUMMARY.md 251 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Creating Database Migrations

Workflow

  1. Identify the right migration directory.

- Main database migrations live in packages/database/lib/migrations/. - Other services may have their own migration directories; use the directory for the service being changed.

  1. Before writing a migration, read 2-3 recent migrations in the same directory and follow their style.
  1. Name new main database migrations with the timestamped CommonJS format:

``text <YYYYMMDDHHMMSS>_<description>.cjs ``

Example:

``text 20260420120000createcustomer_keys.cjs ``

  1. Decide exports.down explicitly.

- Ask the user whether rollback logic should be included or exports.down should be left empty. - If the user already specified rollback behavior, follow that direction.

  1. Choose foreign key delete behavior from the relationship:

- Use ON DELETE CASCADE for ownership relationships where the child cannot exist without the parent. - Use ON DELETE SET NULL for optional references where the child should survive parent deletion. - Check existing migrations for the closest matching relationship before choosing.

Review Checklist

  • Migration is in the correct service migration directory.
  • Filename uses the timestamped .cjs migration format.
  • Style matches recent migrations in the same directory.
  • exports.down behavior was confirmed or explicitly requested.
  • Foreign keys use CASCADE for ownership and SET NULL for optional references.