Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration version detection #395

Closed
wzrdtales opened this issue Aug 7, 2016 · 0 comments
Closed

Add migration version detection #395

wzrdtales opened this issue Aug 7, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@wzrdtales
Copy link
Member

wzrdtales commented Aug 7, 2016

Foreword

With the 0.10.x release, we introduce some breaking changes. Some that no one ever is going to notice, but recently, based on the latest decision, it was decided to remove the deprecated async and dbm globals and with it the async dependency completely.

This opens the need to migrate the users migrations, that potentially rely on those being available as global. Especially as the create template was generating always constructs like

 async = async || require('async');

Thus we need some way to give the user a way to migrate, or even migrate completely automatically. The first thing this needs more information from the migrations, or more exactly containing the version information of the migration.

Specification

A new export is being added to the migrations, defining the migration version. This indicator should be used to point the user either into the right direction of things he needs to do, or if possible even migrate those migrations for the user automatically.

Version control

For automatic steps, all automations shall check for Git and if it is not available, the automation shall take backups in the case that something goes terribly wrong. If git is available it should check if the current worktree is clean and all migrations are tracked, if not abort and warn the user. If the worktree is clean we execute the automated task, and instruct the user to verify everything worked as expected with git diff and otherwise rollback either through a deciated command of db-migrate or of git available also via git reset HEAD~ --hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant