From cf16f8a65fa6452795c8b5bef6c6bcb3c2ba809a Mon Sep 17 00:00:00 2001 From: Ryan Kelly Date: Fri, 16 Oct 2015 21:58:19 +1100 Subject: [PATCH] chore(clients): remove deprecated 'whitelisted' column from clients table. --- lib/db/mysql/patch.js | 2 +- lib/db/mysql/patches/patch-011-012.sql | 5 +++++ lib/db/mysql/patches/patch-012-011.sql | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 lib/db/mysql/patches/patch-011-012.sql create mode 100644 lib/db/mysql/patches/patch-012-011.sql diff --git a/lib/db/mysql/patch.js b/lib/db/mysql/patch.js index e46df45..e834be0 100644 --- a/lib/db/mysql/patch.js +++ b/lib/db/mysql/patch.js @@ -6,4 +6,4 @@ // Update this if you add a new patch, and don't forget to update // the documentation for the current schema in ../schema.sql. -module.exports.level = 11; +module.exports.level = 12; diff --git a/lib/db/mysql/patches/patch-011-012.sql b/lib/db/mysql/patches/patch-011-012.sql new file mode 100644 index 0000000..5a8321c --- /dev/null +++ b/lib/db/mysql/patches/patch-011-012.sql @@ -0,0 +1,5 @@ +-- Drop whitelisted column + +ALTER TABLE clients DROP COLUMN whitelisted; + +UPDATE dbMetadata SET value = '12' WHERE name = 'schema-patch-level'; diff --git a/lib/db/mysql/patches/patch-012-011.sql b/lib/db/mysql/patches/patch-012-011.sql new file mode 100644 index 0000000..36c8206 --- /dev/null +++ b/lib/db/mysql/patches/patch-012-011.sql @@ -0,0 +1,6 @@ +-- (commented out to avoid accidentally running this in production...) + +-- ALTER TABLE clients ADD COLUMN whitelisted BOOLEAN DEFAULT FALSE; +-- UPDATE clients SET whitelisted=trusted; + +-- UPDATE dbMetadata SET value = '11' WHERE name = 'schema-patch-level';