From 3b9144ba4d531a6a8b5818e14f6e41f9e7d8db96 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 23 Feb 2017 17:56:32 +0100 Subject: [PATCH] Alter the backups.dependsOn field to store as TEXT Fixes #239 --- .../20170223165502-backups-alter-dependsOn.js | 15 +++++++++++++++ migrations/schema.sql | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 migrations/20170223165502-backups-alter-dependsOn.js diff --git a/migrations/20170223165502-backups-alter-dependsOn.js b/migrations/20170223165502-backups-alter-dependsOn.js new file mode 100644 index 000000000..5e784e42c --- /dev/null +++ b/migrations/20170223165502-backups-alter-dependsOn.js @@ -0,0 +1,15 @@ +'use strict'; + +exports.up = function(db, callback) { + db.runSql('ALTER TABLE backups MODIFY dependsOn TEXT', [], function (error) { + if (error) console.error(error); + callback(error); + }); +}; + +exports.down = function(db, callback) { + db.runSql('ALTER TABLE backups MODIFY dependsOn VARCHAR(4096)', [], function (error) { + if (error) console.error(error); + callback(error); + }); +}; diff --git a/migrations/schema.sql b/migrations/schema.sql index 1e9211491..ffa7e93ca 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -105,7 +105,7 @@ CREATE TABLE IF NOT EXISTS backups( creationTime TIMESTAMP, version VARCHAR(128) NOT NULL, /* app version or box version */ type VARCHAR(16) NOT NULL, /* 'box' or 'app' */ - dependsOn VARCHAR(4096), /* comma separate list of objects this backup depends on */ + dependsOn TEXT, /* comma separate list of objects this backup depends on */ state VARCHAR(16) NOT NULL, PRIMARY KEY (filename));