From 4073f6a96774c1521019f0f9d611e5d5260cfa53 Mon Sep 17 00:00:00 2001 From: azivner Date: Thu, 2 Nov 2017 23:02:35 -0400 Subject: [PATCH] removed ID from options, opt_name is now new primary key --- migrations/0024__remove_id_from_options.sql | 11 +++++++++++ services/migration.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 migrations/0024__remove_id_from_options.sql diff --git a/migrations/0024__remove_id_from_options.sql b/migrations/0024__remove_id_from_options.sql new file mode 100644 index 000000000..68dfc9785 --- /dev/null +++ b/migrations/0024__remove_id_from_options.sql @@ -0,0 +1,11 @@ +CREATE TABLE `options_mig` ( + `opt_name` TEXT NOT NULL PRIMARY KEY, + `opt_value` TEXT, + `date_modified` INT +); + +INSERT INTO options_mig (opt_name, opt_value, date_modified) + SELECT opt_name, opt_value, date_modified FROM options; + +DROP TABLE options; +ALTER TABLE options_mig RENAME TO options; diff --git a/services/migration.js b/services/migration.js index 1d8a71a84..98e7b9884 100644 --- a/services/migration.js +++ b/services/migration.js @@ -4,7 +4,7 @@ const options = require('./options'); const fs = require('fs-extra'); const log = require('./log'); -const APP_DB_VERSION = 23; +const APP_DB_VERSION = 24; const MIGRATIONS_DIR = "./migrations"; async function migrate() {