Index of every page on this site: llms.txt
All skills
nangohq avatar

/creating-database-migrations

@0c949ea
by Nangonangohq/nango13k stars
1,543
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/nangohq/nango/creating-database-migrations

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈61 tokens for metadata: the name and description. ≈380 when used: this file.

Description uses 3.1% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈246 characters, or 3.1%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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.
  2. Before writing a migration, read 2-3 recent migrations in the same directory and follow their style.

  3. Name new main database migrations with the timestamped CommonJS format:

    <YYYYMMDDHHMMSS>_<description>.cjs

    Example:

    20260420120000_create_customer_keys.cjs
  4. 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.
  5. 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.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    The skill provides workflow instructions for creating database migrations and contains no malicious code or security risks.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 0c949ea. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 6 months ago

README badge

README badge for nangohq/nango/creating-database-migrations