Skip to content

Commit

Permalink
refactor(transition): remove transitioner entirely
Browse files Browse the repository at this point in the history
since it is not needed anymore.

BREAKING CHANGE: the transitioner will disappear from the API
entirely. The need for it disappeared since it was there to
help with the migration from very old migration schemas to
the new ones that did not support very old globals and async
the library provided by db-migrate itself.
Users that for some reason need that can get it from the v0.11.x
versions and then migrate to the newest version afterwards.

Refers to #627

Signed-off-by: Tobias Gurtzick <[email protected]>
  • Loading branch information
wzrdtales committed Apr 16, 2020
1 parent 8874fa6 commit a0432f1
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 479 deletions.
7 changes: 0 additions & 7 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,6 @@ dbmigrate.prototype = {
return log.silence(isSilent);
},

/**
* Transition migrations to the latest defined protocol.
*/
transition: function () {
load('transition')(this.internals);
},

/**
* Creates a correctly formatted migration
*/
Expand Down
7 changes: 1 addition & 6 deletions lib/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ var yargs = require('yargs');

function run (internals, config) {
const { load } = internals;
const transition = load('transition');
var action = internals.argv._.shift();
var folder = action.split(':');

action = folder[0];

switch (action) {
case 'transition':
transition(internals);
break;
case 'create':
if (folder[1]) {
internals.matching = folder[1];
Expand Down Expand Up @@ -114,8 +110,7 @@ function run (internals, config) {
);
} else {
log.error(
'Invalid Action: Must be [up|down|check|create|reset|sync|' +
'db|transition].'
'Invalid Action: Must be [up|down|check|create|reset|sync|db].'
);
yargs.showHelp();
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/set-default-argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function (internals, isModule) {
internals.argv = yargs
.default(defaultConfig)
.usage(
'Usage: db-migrate [up|down|check|reset|sync|create|db|transition] ' +
'Usage: db-migrate [up|down|check|reset|sync|create|db] ' +
'[[dbname/]migrationName|all] [options]'
)
.describe(
Expand Down
5 changes: 0 additions & 5 deletions lib/commands/transition.js

This file was deleted.

30 changes: 0 additions & 30 deletions lib/transitions/1.js

This file was deleted.

22 changes: 0 additions & 22 deletions lib/transitions/ask.js

This file was deleted.

8 changes: 0 additions & 8 deletions lib/transitions/snippets/setup.sjs

This file was deleted.

78 changes: 0 additions & 78 deletions lib/transitions/transitioner.js

This file was deleted.

113 changes: 0 additions & 113 deletions lib/transitions/try-require.js

This file was deleted.

48 changes: 0 additions & 48 deletions lib/transitions/update-version.js

This file was deleted.

Loading

0 comments on commit a0432f1

Please sign in to comment.