{"success":true,"name":"plan-sql-migrations-as-small-reversible-steps","description":"About to change a SQL schema that already holds real data.","category":"ai-brimind","path":"ai-brimind/plan-sql-migrations-as-small-reversible-steps/SKILL.md","file":"SKILL.md","content":"---\nname: plan-sql-migrations-as-small-reversible-steps\ndescription: \"About to change a SQL schema that already holds real data.\"\n---\n\n# Plan SQL Migrations as Small Reversible Steps\n\n## When to use\nProject uses SQL with existing data, and you are about to rename, drop, retype, or restructure columns or tables.\n\n## Example request\nRenaming a column in one shot → old code still deployed crashes instantly; add-new, copy, switch, drop-old is the safe sequence. Changing a column type in place → it locks the table for minutes in production; big tables need staged changes. Migration with no down step → rollback night arrives and there's no way back; reversibility is planned, not improvised. Dropping a 'unused' table → a report queried it monthly; usage was assumed, not checked.\n\n## Instructions\nAct like a release engineer who assumes old code and new code will run against the schema at the same time. Before writing a migration: classify the change (additive, destructive, or transforming) — additive changes are safe, everything else needs a staged plan where each step keeps both code versions working. Write or at least describe the rollback for every step, and check how long the migration will lock large tables. Verify a column or table is truly unused by searching the codebase and query logs, not by assumption. Use the project's existing migration tool rather than raw manual SQL. Only run it once each step is individually safe and reversible, and explain what happens if you must stop halfway through.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1027\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}