migrate

Generates PostgreSQL schema migrations and updates data-model.md and initDb() accordingly.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/levori119/skyboard --skill migrate-levori119
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate
Source: https://github.com/levori119/skyboard/tree/main/.claude/skills/migrate
Command: npx skills add https://github.com/levori119/skyboard --skill migrate-levori119

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Schema changes in the SKY-KING PostgreSQL (Neon) database risk becoming inconsistent across the SQL migration, the data model documentation, and the server initialization code. This Skill enforces a single disciplined workflow so every database change is documented, idempotent, and synchronized with the codebase. ## Core Features & Use Cases - Structured SQL Migrations: Produces numbered, dated migration scripts wrapped in BEGIN/COMMIT with IF NOT EXISTS / IF EXISTS guards for safe re-runs. - Documentation Sync: Updates data-model.md with the new column name, type, and Hebrew description whenever the schema changes. - initDb() Integration: Appends ALTER TABLE ... ADD COLUMN IF NOT EXISTS statements to the relevant block in server.js without modifying existing CREATE TABLE statements. - Safety Guardrails: Blocks DROP COLUMN, TRUNCATE, and DELETE operations without explicit CEO approval, and requires rollback notes for reversible migrations. - Use Case: When adding a new field to the strips table, the Skill reads data-model.md, checks initDb() for duplicates, writes the migration SQL, updates the docs, and outputs a ready-to-run script for the Neon console. ## Quick Start Ask the assistant to create a database migration for adding a new column to a table, and it will produce the SQL, update data-model.md, and patch initDb() in server.js.

Frequently Asked Questions about migrate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a PostgreSQL migration for adding a new column?

Write an ALTER TABLE statement with ADD COLUMN IF NOT EXISTS inside a BEGIN/COMMIT block, including a header comment with the migration number, date, and reason. Then update data-model.md and append the same ALTER statement to initDb() in server.js.

How do I keep database schema documentation in sync with migrations?

Update data-model.md in the same change as the migration, recording the new column name, type, Hebrew description, and when it appears. The Skill treats a migration as incomplete until the documentation is updated.

Can I drop a column or run DELETE in a migration?

No. DROP COLUMN, TRUNCATE, and DELETE operations require explicit CEO approval before being included in any migration. The Skill refuses to generate destructive SQL without that authorization.

Why use IF NOT EXISTS in PostgreSQL migration scripts?

IF NOT EXISTS makes migrations idempotent, so re-running them against a database that already has the column or index does not fail. This is essential for Neon environments where initDb() also applies ALTER statements at server startup.

Should I modify existing CREATE TABLE statements when changing schema?

No. Never alter an existing CREATE TABLE definition. Instead, append ALTER TABLE ... ADD COLUMN IF NOT EXISTS lines at the end of the relevant block in initDb() so existing deployments upgrade safely.