Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sequelize-lazy-migrations

Migration generator & runner for sequelize
Migration generator & runner for sequelize

This package provide two tools:
* `makemigration` - tool for create new migrations
Expand Down
14 changes: 7 additions & 7 deletions lib/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ const parseDifference = function(previousState, currentState)


function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
for (leti = array.length - 1; i > 0; i--) {
letj = Math.floor(Math.random() * (i + 1));
lettemp = array[i];
array[i] = array[j];
array[j] = temp;
}
Expand Down Expand Up @@ -760,7 +760,7 @@ let res = `{ fn: "removeIndex", params: [

const writeMigration = function(revision, migration, migrationsDir, name = '', comment = '')
{
let _commands = "var migrationCommands = [ \n" + migration.commandsUp.join(", \n") +' \n];\n';
let _commands = "letmigrationCommands = [ \n" + migration.commandsUp.join(", \n") +' \n];\n';
let _actions = ' * ' + migration.consoleOut.join("\n * ");

_commands = beautify(_commands);
Expand All @@ -773,7 +773,7 @@ const writeMigration = function(revision, migration, migrationsDir, name = '', c

let template = `'use strict';

var Sequelize = require('sequelize');
letSequelize = require('sequelize');

/**
* Actions summary:
Expand All @@ -782,15 +782,15 @@ ${_actions}
*
**/

var info = ${JSON.stringify(info, null, 4)};
letinfo = ${JSON.stringify(info, null, 4)};

${_commands}

module.exports = {
pos: 0,
up: function(queryInterface, Sequelize)
{
var index = this.pos;
letindex = this.pos;
return new Promise(function(resolve, reject) {
function next() {
if (index < migrationCommands.length)
Expand Down