Separating the partial-rollback from roll forward in migration scripts
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- postgresql, typescript
- Ambito
- databases
Direzione di ricerca
L’issue non indica file, test o punti di ingresso. Inizia individuando i percorsi di esecuzione delle migrazioni per lo sviluppo, la produzione e i controlli di roll-forward del database shadow; il lavoro è completo quando il comportamento e il meccanismo di separazione sono specificati e coperti da test per ogni percorso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem statement / motivation
As a new user introducing graphile-migrate to a team, I've noticed that code review of migrations is complicated by the need to thoroughly check the DROP statements that are required for idempotency. This is a point of friction for introducing the tooling, as people responsible for operational databases are nervous about having migrations containing a lot of DROP statements. It seems we currently have the following tradeoff
- If someone writes an errant
DROPstatement for a resource in the existing schema, data loss will occur in production. - However, various
DROPstatements are a necessary part of idempotency and havinggraphile-migrate watchwork during development.
Feature description
I find that it's often possible to separate migrations into two halves which seem like they could be treated differently in production and development:
- The
DROP(or other) statements which remove any resources previously created during development. This is like a partial rollback which is happy to destroy data, and only needs to get the DB in a state where the roll forward phase can reliably be reapplied. - The roll forward migration statements needed for production.
If graphile-migrate guaranteed to only apply (2) in production (and for the shadow db rollforward check phase) it would seem unnecessary for (1) to be thoroughly vetted in code review, and reduce overall risk of applying a migration.
I'm not sure what this feature would look like. Could it be a comment which separates migration files into two sections? That seems a little fragile (eg, what if the comment is spelled wrong?), but it would be minimally breaking.
Supporting development
I could potentially help build this.
- am interested in building this feature myself
- am interested in collaborating on building this feature
- am willing to help testing this feature before it's released
- am willing to write a test-driven test suite for this feature (before it exists)
- am a Graphile sponsor ❤️
- have an active support or consultancy contract with Graphile
- Lingua principale
- TypeScript
- Stelle
- 836
- Fork
- 71
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 graphile/migrate
-
Partition migrations folderAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
🐛 bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
Tutte le issue di graphile/migrate
Issue simili
-
foreground-up-signals-live: delivery-repair cell expects a spawn suggestion status no longer printsApertabug triage:owned
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4905 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
directus/directus#28558 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
review: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
1lck/Lithe-IDEA#2432 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
cloudflare/workers-sdk#17189 ·
I maintainer di solito rispondono entro 1 giorno