Skip to content
Back to skills

Add A Migration

ASecurity

Change the database schema across both SQLite and PostgreSQL with matching migrations. Read before editing core/crates/control-plane/migrations or the store.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 23, 2026
ai-agentsrustgosqlapidatabase

Works with

  • api

Security analysis

A100/100

Scanned November 23, 2026

npx -y skills add atemaguer/supertag --skill add-a-migration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add A Migration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add A Migration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/atemaguer-add-a-migration/badge)](https://www.skillsdirectory.com/skills/atemaguer-add-a-migration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-a-migration
description: Change the database schema across both SQLite and PostgreSQL with matching migrations. Read before editing core/crates/control-plane/migrations or the store.
---

# Add a migration

The Control Plane supports two databases: SQLite for local and single-process use, PostgreSQL for
production and replicas. **Both are first-class.** Every schema change touches both.

## Files that must stay in sync

| File | Purpose |
| --- | --- |
| `core/crates/control-plane/migrations/sqlite/NNNN_name.sql` | SQLite migration |
| `core/crates/control-plane/migrations/postgresql/NNNN_name.sql` | PostgreSQL migration with the same number and name |
| `core/crates/control-plane/src/store.rs` | The ordered `include_str!` lists, one per dialect |

## Procedure

1. Add the next-numbered migration to **both** directories. Keep column names, nullability, and
   defaults semantically equivalent; the types and locking differ per dialect by design.
2. Append both files to the matching `include_str!` lists in `store.rs`, in order.
3. Update the store code for both dialects where queries differ.
4. Run the store contracts on both databases:

   ```sh
   export SUPERTAG_RUST_TEST_POSTGRES_URL_FILE=/path/to/private-url-file
   SUPERTAG_RUST_TEST_REQUIRE=postgres cargo test --manifest-path core/Cargo.toml --locked \
     -p supertag-control-plane -- --include-ignored
   ```

   PostgreSQL cases are ignored without the URL file. With `SUPERTAG_RUST_TEST_REQUIRE=postgres`
   a missing database fails the run instead of skipping. Do not trust a run that skipped them.

## Footguns

**Never edit a migration that has merged.** Add a new one.

**Tables are internal.** See `docs/reference/api-stability.md`. You may restructure them, but not
break documented resource shapes. The Control Plane applies pending migrations when it starts, so
a migration runs against existing databases, not only fresh ones.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.