Add feature to undo "grouped" migrations (applied with the same command) with only one command
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
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Start by tracing the Sequelize CLI migrate and undo commands and how the sequelizemeta table records applied migrations. Define the behavior for grouping migrations from one command, including rollback order and metadata handling; done means a command can undo exactly the latest migration group. No files or tests are named, so repository exploration is required.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello,
I am self-taught in DataBase management and usage. First I was using no tools to interface my program to the DB. I was writing all manualy. Next I have used the interface of Laravel in PHP ("Eloquent"). Now, I use Sequelize in my NodeJS project.
I have not found any information about my followinf suggestion but if it's already addressed, please just tell me.
I suggest to add a feature for migration to the sequelize CLI and maybe also to ohter sequelize parts (I don't knw how you are managing migration).
I suggest to add the possibility to undo all migration that are apply by the same command (like in Laravel Eloquent).
For exemple, If there are 5 migration applied and 3 pending migration. When you execute the migrate command, Sequelize will migrate the 3 pending migration. If you want to revert it, you have to undo 3 time or precize the migration name. I propose to add a command (maybe "db:migrate:undo:group") to automaticaly revert migrations that was applied by the same migrate command.
This is very usefull for production usage. When customer deploy an application, he as to migrate a first time, OK all migrations are applied. Next, I send an application update, the customer migrate simply migrate again and all new migration are applied. Now if the customer need to comeback to the previous version, he as to undo migration so, actually, he need to check name of last migration of the previous version. With my proposition, customer simply undo the last "group" (same time migration) and the app revert the the previous version because all migrations of the new version was applied by the same command.
To do it, I suggest to add a boolean column to the "sequelizemeta" table named "grouped". Migration row is set to false for first applied migration done by a migrate command and all next migrations applied by this same command is set to true because they are "grouped" with precedent. So at eatch execution of the migration command, a row and only one is set to false. The "undo:group" command has just to undo last migration and check if this unded migration was set to true. If yes, automatically undo the previous migration and so one while "grouped" field is true.
I can develop more or explain differently but I realy think that it can be a very good addition for production and most generaly to don't care of migration name while migrate or revert between program version.
Best Regards,
- Lingua principale
- JavaScript
- Stelle
- 2.6k
- Fork
- 524
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un 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 sequelize/cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Tutte le issue di sequelize/cli
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
aiko-chan-ai/DiscordBotClient#380 ·
-
Offisielle trærAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Daemon delete dialog: "Remove all ExApps" checkbox and `removeExApps` parameter have no effectAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 3 giorni
-
Add: Atlas TVApertachannels:add check:passed
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 4 giorni