From 8cb8510d72c662f64f4de3f2f9e3f41322d065da Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 11 Nov 2016 10:48:33 +0530 Subject: [PATCH] Add sso db field SSO field tracks whether the user wants to enable SSO integration or not. --- migrations/20161111051640-appdb-add-sso.js | 16 ++++++++++++++++ migrations/schema.sql | 1 + 2 files changed, 17 insertions(+) create mode 100644 migrations/20161111051640-appdb-add-sso.js diff --git a/migrations/20161111051640-appdb-add-sso.js b/migrations/20161111051640-appdb-add-sso.js new file mode 100644 index 000000000..fe96dc6d1 --- /dev/null +++ b/migrations/20161111051640-appdb-add-sso.js @@ -0,0 +1,16 @@ +var dbm = global.dbm || require('db-migrate'); +var type = dbm.dataType; + +exports.up = function(db, callback) { + db.runSql('ALTER TABLE apps ADD COLUMN sso BOOLEAN DEFAULT 1', function (error) { + if (error) console.error(error); + callback(error); + }); +}; + +exports.down = function(db, callback) { + db.runSql('ALTER TABLE apps DROP COLUMN sso', function (error) { + if (error) console.error(error); + callback(error); + }); +}; diff --git a/migrations/schema.sql b/migrations/schema.sql index 2b7a7908e..a7226fb70 100644 --- a/migrations/schema.sql +++ b/migrations/schema.sql @@ -68,6 +68,7 @@ CREATE TABLE IF NOT EXISTS apps( memoryLimit BIGINT DEFAULT 0, altDomain VARCHAR(256), xFrameOptions VARCHAR(512), + sso BOOLEAN DEFAULT 1, // whether user chose to enable SSO lastBackupId VARCHAR(128), // tracks last valid backup, can be removed