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);
|
CREATE TABLE IF NOT EXISTS configuration_new (
|
||||||
INSERT INTO configuration (value_new) SELECT value FROM configuration;
|
username varchar(255),
|
||||||
ALTER TABLE configuration DROP COLUMN value;
|
confkey varchar(255),
|
||||||
ALTER TABLE configuration RENAME COLUMN value_new TO value;
|
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;
|
CREATE TABLE IF NOT EXISTS configuration_new (
|
||||||
INSERT INTO configuration (value_new) SELECT value FROM configuration;
|
username varchar(255),
|
||||||
ALTER TABLE configuration DROP COLUMN value;
|
confkey varchar(255),
|
||||||
ALTER TABLE configuration RENAME COLUMN value_new TO value;
|
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