Migration safety: dry-run plan, lock-aware advisor, one-click rollback
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
Direzione di ricerca
This is a design-scale proposal covering a migration planner, runner, reversible down migrations, schema snapshots and an admin UI history view; no files or entry points are named. Start by reading how AutoMigrate is currently invoked and where the grit CLI registers its commands, then sketch the plan/up/down/restore command surface before touching implementation. Done means grit migrate plan flags an unsafe NOT NULL add before execution, a failed migration can be restored to its pre-state in under 30s, and migration history is diff-able in the admin UI.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Vision
Database migrations are the highest-blast-radius operation in any deploy. "Migration locked the table for 90 seconds during peak" is a story every senior engineer has lived. The framework's AutoMigrate is friendly for prototypes but dangerous at scale.
Proposal
A migration toolchain that grows up with the app:
- `grit migrate plan` — prints the SQL the migration will run, the estimated lock time per statement, and warnings for known-dangerous patterns:
- `ALTER TABLE … ADD COLUMN NOT NULL` without a default → suggests two-step migration
- `ALTER TABLE … ADD INDEX` → warns about lock duration on N-row tables
- `DROP COLUMN` → blocks unless explicitly approved (data loss)
- Destructive ops on tables > N rows → require an explicit `--i-understand` flag
- `grit migrate up` — runs the plan with progress reporting + automatic transaction wrap
- `grit migrate down` — auto-generated reverse migrations for every `up` (where reversible)
- Schema snapshots before/after every migration → `grit migrate restore ` rolls back to a snapshot
- Migration history in admin UI with diff view per migration
Why this is differentiating
Liquibase and Flyway exist; nothing comparable for Go + GORM + opinionated app frameworks. "Run a safe migration" is a recurring stress event for every engineering team.
Acceptance
- `grit migrate plan` catches an unsafe `NOT NULL` add before it locks production
- A migration that fails halfway can be rolled back to its pre-state in <30s
- Migration history is queryable + diff-able in the admin UI
- Lingua principale
- Go
- Stelle
- 152
- Fork
- 20
- Merge medio
- 1g 49m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MUKE-coder/grit
-
[Plugin] calendarAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MUKE-coder/grit#228 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
MUKE-coder/grit#227 ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
MUKE-coder/grit#224 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
MUKE-coder/grit#199 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
MUKE-coder/grit#179 · 4 commenti ·
Tutte le issue di MUKE-coder/grit
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
txn2/mcp-data-platform#2728 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
blinklabs-io/dingo#6504 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
SocialGouv/iterion#3413 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
orion-belt-dev/orion-belt#181 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
kubesmarts/logic-operator#105 ·
I maintainer di solito rispondono entro 1 giorno