Skip to content

Commit

Permalink
Add database migration to 3.11.5 to add column color to table area
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Dec 6, 2018
1 parent 7693067 commit f8de99d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/core/task/task.dbMigration.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ module.exports = function(oldVersion) {

}

if(semver.lt(oldVersion, '3.11.5')) {

// add color column in area
return gladys.utils.sql(`ALTER TABLE area ADD COLUMN color integer DEFAULT NULL;`).reflect()

// finishing migration
.then(() => gladys.task.updateDbVersion('3.11.5'))
.then(() => gladys.task.dbMigration('3.11.5'));

}

// default, we save in DB the current version of Gladys
return gladys.task.updateDbVersion(gladys.version);
};

0 comments on commit f8de99d

Please sign in to comment.