From de6d32171f2577ead8c1f091b0065ea14d4030d6 Mon Sep 17 00:00:00 2001 From: groot Date: Wed, 20 Nov 2019 19:54:18 +0800 Subject: [PATCH] add script for meta migration --- core/scripts/migration/mysql_6_to_4.sql | 3 +++ core/scripts/migration/sqlite_6_to_4.sql | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 core/scripts/migration/mysql_6_to_4.sql create mode 100644 core/scripts/migration/sqlite_6_to_4.sql diff --git a/core/scripts/migration/mysql_6_to_4.sql b/core/scripts/migration/mysql_6_to_4.sql new file mode 100644 index 00000000..96c60e02 --- /dev/null +++ b/core/scripts/migration/mysql_6_to_4.sql @@ -0,0 +1,3 @@ +alter table Tables drop column owner_table; +alter table Tables drop column partition_tag; +alter table Tables drop column version; diff --git a/core/scripts/migration/sqlite_6_to_4.sql b/core/scripts/migration/sqlite_6_to_4.sql new file mode 100644 index 00000000..686d276f --- /dev/null +++ b/core/scripts/migration/sqlite_6_to_4.sql @@ -0,0 +1,7 @@ +CREATE TABLE 'TempTables' ( 'id' INTEGER PRIMARY KEY NOT NULL , 'table_id' TEXT UNIQUE NOT NULL , 'state' INTEGER NOT NULL , 'dimension' INTEGER NOT NULL , 'created_on' INTEGER NOT NULL , 'flag' INTEGER DEFAULT 0 NOT NULL , 'index_file_size' INTEGER NOT NULL , 'engine_type' INTEGER NOT NULL , 'nlist' INTEGER NOT NULL , 'metric_type' INTEGER NOT NULL); + +INSERT INTO TempTables SELECT id, table_id, state, dimension, created_on, flag, index_file_size, engine_type, nlist, metric_type FROM Tables; + +DROP TABLE Tables; + +ALTER TABLE TempTables RENAME TO Tables; -- GitLab