mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
Fix sqlite migration for configuration
This commit is contained in:
parent
b6be76eb07
commit
b5a7249ad5
@ -1,4 +1,10 @@
|
||||
ALTER TABLE configuration ADD COLUMN value_new varchar(255);
|
||||
INSERT INTO configuration (value_new) SELECT value FROM configuration;
|
||||
ALTER TABLE configuration DROP COLUMN value;
|
||||
ALTER TABLE configuration RENAME COLUMN value_new TO value;
|
||||
CREATE TABLE IF NOT EXISTS configuration_new (
|
||||
username varchar(255),
|
||||
confkey varchar(255),
|
||||
value varchar(255),
|
||||
PRIMARY KEY (username, confkey),
|
||||
FOREIGN KEY (username) REFERENCES user (username) ON DELETE CASCADE ON UPDATE NO ACTION);
|
||||
|
||||
INSERT INTO configuration_new SELECT * FROM configuration;
|
||||
DROP TABLE configuration;
|
||||
ALTER TABLE configuration_new RENAME TO configuration;
|
||||
|
@ -1,4 +1,10 @@
|
||||
ALTER TABLE configuration ADD COLUMN value_new TEXT;
|
||||
INSERT INTO configuration (value_new) SELECT value FROM configuration;
|
||||
ALTER TABLE configuration DROP COLUMN value;
|
||||
ALTER TABLE configuration RENAME COLUMN value_new TO value;
|
||||
CREATE TABLE IF NOT EXISTS configuration_new (
|
||||
username varchar(255),
|
||||
confkey varchar(255),
|
||||
value text,
|
||||
PRIMARY KEY (username, confkey),
|
||||
FOREIGN KEY (username) REFERENCES user (username) ON DELETE CASCADE ON UPDATE NO ACTION);
|
||||
|
||||
INSERT INTO configuration_new SELECT * FROM configuration;
|
||||
DROP TABLE configuration;
|
||||
ALTER TABLE configuration_new RENAME TO configuration;
|
||||
|
Loading…
Reference in New Issue
Block a user