cc-backend/internal/repository/migrations/sqlite3/06_change-config.up.sql

11 lines
372 B
MySQL
Raw Permalink Normal View History

2023-06-30 09:15:58 +02:00
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;