nodefony-migrate-schema

Migrates Nodefony database schemas to production using orm:generate and orm:migrate commands.

Updated Dec 19, 2023
One-click install
npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-migrate-schema-nodefony
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodefony-migrate-schema
Source: https://github.com/nodefony/nodefony-core/tree/main/.claude/skills/nodefony-migrate-schema
Command: npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-migrate-schema-nodefony

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @nodefony/devkit.

What problem does it solve? Changing an entity that already exists in a live database is risky: a hand-written ALTER, a dropped database, or a migration applied after deployment can break the schema history or take the application down. This Skill enforces the safe Nodefony workflow for evolving a schema and shipping it to production. ## Core Features & Use Cases - Guided schema migration: Evolves the database exclusively through the orm:generate and orm:migrate commands, never through manual ALTER statements or database deletion. - State reading and planning: Reads the current schema state whether or not the application is running, and produces a plan before any change is applied. - Refusal codes and prohibitions: Maps each refusal code to the action it requires, and lists the three forbidden operations that corrupt a migration history. - Deployment pattern: Applies migrations BEFORE application instances during deployment, and covers adopting an existing database and repairing a failed migration. - Use Case: You added a field to an entity and production now reports "no such column". Use this Skill to generate the migration, review the plan, and deploy it before the new code rolls out. ## Quick Start Ask the assistant to migrate the Nodefony schema after adding a field to an entity, so it generates and applies the migration with orm:generate and orm:migrate before deployment.

Frequently Asked Questions about nodefony-migrate-schema

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

FAQPage Schema
How do I migrate a Nodefony database schema after changing an entity?

Run orm:generate to create the migration from the entity change, review the plan, then apply it with orm:migrate. Never write an ALTER statement by hand or delete the database, as these break the migration history.

How do I deploy a schema change to production in Nodefony?

Apply the migrations BEFORE the application instances during deployment. This ordering ensures the database schema is ready before any running code depends on the new columns or tables.

Why does Nodefony report "no such column" after I added a field?

The entity was changed but the corresponding migration was never generated or applied to the database. Run orm:generate to create the migration, then orm:migrate to add the missing column.

Can I adopt an existing database into a Nodefony migration history?

Yes, the Skill covers adopting an existing database by reading its current state, which works whether or not the application is running, and then establishing the migration baseline before further changes.

What should I do when a Nodefony migration fails?

Read the refusal code returned by the migration command, since each code maps to a specific corrective action. Avoid the three forbidden operations that corrupt migration history, then repair and re-apply the migration.