{"success":true,"name":"snapshot-the-data-before-any-bulk-sql-change","description":"About to run a SQL script touching many rows or a schema.","category":"ai-brimind","path":"ai-brimind/snapshot-the-data-before-any-bulk-sql-change/SKILL.md","file":"SKILL.md","content":"---\nname: snapshot-the-data-before-any-bulk-sql-change\ndescription: \"About to run a SQL script touching many rows or a schema.\"\n---\n\n# Snapshot the Data Before Any Bulk SQL Change\n\n## When to use\nProject uses SQL, and you are about to run a bulk UPDATE/DELETE, a data migration, or a manual fix script against data that would be painful to lose.\n\n## Example request\nMigration script 'tested on dev' → production data had shapes dev never did; the backup was the only way back. Quick manual fix in the prod console → fat-fingered the WHERE; CREATE TABLE backup_x AS SELECT took five seconds beforehand. Trusting last night's backup → nobody ever tested restoring it; an unverified backup is a hope, not a plan. Bulk change inside one giant transaction → it locked the table for ten minutes; snapshot plus batches was the operable path.\n\n## Instructions\nAct like an operator whose first question is 'how do I get back to the state before this ran?' Before any bulk write or migration: create a concrete restore point — a table copy of the affected rows (CREATE TABLE ... AS SELECT), a dump, or a verified snapshot — and know the actual restore command, not just that a backup 'exists'. Prefer running the change in batches with progress logging over one giant statement. Dry-run the script's SELECT equivalent to see the scope first. If no restore path is possible, that's a blocker to raise, not a risk to accept silently. Only execute once the way back is real and tested, and record what was changed so recovery is targeted, not total.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1038\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}