migration-review
Skill214 starsChanged 30 days agoMITView on GitHub
SQLite migration assessment for items with the needs-migration-review trait. Evaluates schema changes, table recreation patterns, data migration strategy, and Flyway migration correctness. Invoked via skillPointer when filling migration-assessment notes.
- Deletes or force-pushes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- macro-inc/macrotheir own version, first seen Nov 15, 2026
- Urthella/backend-agent-skillstheir own version, first seen Nov 15, 2026
- paureis/pau-skillstheir own version, first seen Nov 8, 2026
- ryukirin/openspec-code-migrationtheir own version, first seen Nov 1, 2026
- melocalex/agent-knowledge-demotheir own version, first seen Oct 25, 2026
- Shri-Phnx/claude-skillstheir own version, first seen Oct 13, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- macro-inc/macro★ 6.3ksame name
- paureis/pau-skills★ 2same name
- Shri-Phnx/claude-skills★ 2same name
- melocalex/agent-knowledge-demo★ 0same name
- ryukirin/openspec-code-migration★ 0same name
- Urthella/backend-agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- claude-plugins/CLAUDE.mdCLAUDE.md
- add-componentSkill
- api-compat-reviewSkill
- feature-implementationSkill
- implementSkill
- perf-reviewSkill
- plugin-impact-reviewSkill
- prepare-releaseSkill
- review-qualitySkill
- spec-qualitySkill
- test-authorSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Read the changed files and migration SQL to determine:
- Distinctive: line 16
Create new table with desired schema
- Distinctive: line 25
Verify against known SQLite limitations:
- Very specific: line 55
Run on Flyway's connection, which has foreign_keys = OFF and busy_timeout set (do not rely on cascades.
- Very specific: line 56
Create the new table, then INSERT INTO new_t(rowid, c1, ...) SELECT rowid, c1, ...
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migration Review Framework
Evaluate database migration safety for SQLite-specific constraints. This project uses Flyway migrations with SQLite, which has significant limitations compared to PostgreSQL/MySQL.
Step 1: Identify Schema Changes
Read the changed files and migration SQL to determine:
- New columns —
ALTER TABLE ADD COLUMNworks in SQLite - Modified columns — SQLite has NO
ALTER COLUMN. Requires table recreation:- Create new table with desired schema
- Copy data from old table
- Drop old table
- Rename new table
- New tables — a Flyway migration is the only place a table is defined (the Exposed table is a query mapping); there is no second table list to update
- Index changes —
CREATE INDEX/DROP INDEXwork normally
Step 2: SQLite Constraint Check
Verify against known SQLite limitations:
- No
ALTER COLUMN— if modifying existing columns, table recreation pattern is used - No
DROP COLUMNin older SQLite versions — check if the Docker image's SQLite supports it - Foreign key constraints — Flyway's connection runs with
foreign_keys = OFF(see the template below), so aDROP TABLEdoes not cascade; the application connection runs with it ON TEXTaffinity — SQLite stores all strings as TEXT regardless of declared type- No concurrent write transactions — migrations must be sequential
Step 3: Data Migration Strategy
For migrations that modify existing data:
- Existing rows handled — default values for new columns, or explicit data migration
- Null safety — new NOT NULL columns require a DEFAULT or data backfill
- Large table performance — SQLite locks the entire database during writes
- Runtime-dependent guarantees are probed, not assumed — see below
Guarantees that rest on engine runtime behavior need a multi-row probe. When the assessment claims an at-rest, security, or data-integrity guarantee that depends on a specific runtime/engine behavior (e.g. SQLite PRAGMA secure_delete, VACUUM page reuse, WAL checkpoint timing, FTS5 shadow-table residue), the assessment MUST specify a multi-row/multi-write empirical probe as part of the required test strategy — not a single-row assertion, which can read clean whether or not the mechanism works. It MUST NOT phrase the guarantee as absolute ("scrubbed", "removed") when only a probabilistic or partial mechanism is available ("reduces residue", "partial scrub"); once the probe exists, state the measured bound (e.g. "3–14 of 200 rows survive with the pragma, 200+ without").
Step 4: Flyway Integration
- Migration file follows naming:
V{N}__{Description}.sql - Version number is sequential (no gaps, no conflicts with existing migrations)
- Migration is idempotent where possible
- Migration files stay byte-identical once released: Flyway's checksum covers every line including comments, so never edit one (V9's header comment, lines 12-14, says FK enforcement is off by default in this project; in fact the application connection runs
foreign_keys=ON(DatabaseManager) and only Flyway's own connection runs with it OFF. That correction lives here, not in the file, because Flyway checksums comment lines) - Expand/contract: ship additive changes first and remove the old shape in a later release; flag any table-recreating migration in the release notes
- Upgrade harness seed added:
upgrade/seeds/SeedV{N}.ktextendsMigrationSeed({N}), declares the exact expected values of any column it rewrites inexpected(table, row), seeds rows the migration transforms, and asserts the result inverify; any new column also needs a seeded value inBaselineDataset(BaselineColumnCoverageTest). The harness migrates a populated database from N-1 and checks rows, foreign keys, FTS counts and integrity, the trigger inventory andforeign_keys = 0on Flyway's connection; it fails for a V18-or-later migration without a seed
Table-recreation template
Migrations live in current/src/main/resources/db/migration/sqlite/. A migration that recreates a table
(SQLite has no ALTER COLUMN) must:
- Run on Flyway's connection, which has
foreign_keys = OFFandbusy_timeoutset (do not rely on cascades; re-check child rows after). - Create the new table, then
INSERT INTO new_t(rowid, c1, ...) SELECT rowid, c1, ... FROM tto PRESERVE rowids (without the explicit column list the rowid lands in the first declared column): external-content FTS5 tables join onrowid. - Drop the old table, rename the new one, recreate its indexes.
- Recreate every trigger the dropped table owned, since dropping a table drops its triggers. There are six FTS tables (
work_items,notesanddocuments, each in a trigram and a text form;StartupIntegrityFTS_BACKING). Forwork_items, 6 FTS sync triggers (work_items_fts_trigram_ai/_ad/_au,work_items_fts_text_ai/_ad/_au) plus 2 cycle triggers (work_items_cycle_check,work_items_cycle_check_update); fornotes, 6 FTS sync triggers (notes_fts_trigram_ai/_ad/_au,notes_fts_text_ai/_ad/_au); fordocuments, 6 FTS sync triggers (documents_fts_trigram_ai/_ad/_au,documents_fts_text_ai/_ad/_au, V24). Each_autrigger uses its LATEST form, restricted to the indexed columns: notes V8, documents V24 (AFTER UPDATE OF title, body), work_items V26 (AFTER UPDATE OF title, summary, description); the two cycle triggers are also V26. Copy each body from the latest migration that creates it, not from V8. The documents FTS tables join ondoc_rowid(an INTEGER PRIMARY KEY alias ofdocuments), not on the implicitrowid. INSERT INTO <fts>(<fts>) VALUES('rebuild')for the two FTS tables (trigram and text) of the recreated table only. Startup then verifies the trigger/FTS inventory and runs the FTSintegrity-check, so a missed trigger fails startup. Never useVACUUMin a migration: it can renumber rowids.
Step 5: Rollback Considerations
- Can the migration be reversed manually if needed?
- Is the schema change backward compatible with the previous application version?
- Docker volume data survives container restarts — migration is permanent
Output
Compose the migration-assessment note with findings from each step. Flag any SQLite-specific risks. Reference .claude/skills/spec-quality/references/project-concerns.md for additional codebase constraints.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

