'use strict';

module.exports = {
  up: function (queryInterface, Sequelize) {
    return queryInterface.renameColumn('Departments', 'allowence', 'allowance');
  },

  down: function (queryInterface, Sequelize) {
    return queryInterface.renameColumn('Departments', 'allowance', 'allowence');
  }
};

@@ -8,16 +8,58 @@
 rict';%0A%0A
+var models = require('../lib/model/db');%0A%0A
 module.e
@@ -106,32 +106,1494 @@
 e, Sequelize) %7B%0A
+%0A    if ('sqlite' === queryInterface.sequelize.getDialect()) %7B%0A%0A      console.log('Going into SQLIite case');%0A%0A      return queryInterface%0A        // Create Temp Departments based on current model definitiom%0A        .createTable('Departments_backup', models.Department.attributes)%0A%0A        .then(function()%7B%0A          return queryInterface.sequelize.query('PRAGMA foreign_keys=off;');%0A        %7D)%0A%0A        // Copy data form original Departments into new Temp one%0A        .then(function()%7B%0A          return queryInterface.sequelize.query(%0A            'INSERT INTO %60Departments_backup%60 (id, name, include_public_holidays, createdAt, updatedAt, companyId, bossId, allowance) SELECT id, name, include_public_holidays, createdAt, updatedAt, companyId, bossId, allowence FROM %60'+ models.Department.tableName +'%60');%0A        %7D)%0A%0A        .then(function()%7B%0A          return queryInterface.dropTable( models.Department.tableName );%0A        %7D)%0A%0A        .then(function()%7B%0A          return queryInterface.renameTable('Departments_backup', models.Department.tableName);%0A        %7D)%0A%0A        .then(function()%7B%0A          return queryInterface.sequelize.query('PRAGMA foreign_keys=on;');%0A        %7D)%0A%0A        .then(function()%7B%0A          queryInterface.addIndex(models.Department.tableName, %5B'companyId'%5D);%0A        %7D)%0A%0A        .then(function()%7B%0A          queryInterface.addIndex(models.Department.tableName, %5B'id'%5D);%0A        %7D);%0A%0A    %7D else %7B%0A%0A      console.log('Generic option');%0A%0A  
     return query
@@ -1651,25 +1651,76 @@
 'allowance')
-;
+%0A        .then(function(d)%7B console.dir(d) %7D);%0A    %7D
 %0A  %7D,%0A%0A  dow

Add SQLite specific logic for recent migration.