aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorStu Tomlinson <stu@nosnilmot.com>2022-03-08 12:56:27 +0000
committerGitHub <noreply@github.com>2022-03-08 13:56:27 +0100
commitdca49f508f0bb9c8e300993cffc431a998ed5c93 (patch)
tree1da94c73da95ee76e7bf7ac9c9d89c8f5346dc90 /sql
parentUse correct timestamp when hibernation_time is not set at all (diff)
Sync old-to-new schema script with reality (#3790)
Update the update_sql function to match current "new" sql schema
Diffstat (limited to 'sql')
-rw-r--r--sql/pg.new.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/pg.new.sql b/sql/pg.new.sql
index b69e6ddfa..6700a4771 100644
--- a/sql/pg.new.sql
+++ b/sql/pg.new.sql
@@ -161,6 +161,24 @@
-- DROP INDEX i_push_ut;
-- ALTER TABLE push_session ADD PRIMARY KEY (server_host, username, timestamp);
-- CREATE UNIQUE INDEX i_push_session_susn ON push_session USING btree (server_host, username, service, node);
+-- ALTER TABLE push_session ALTER COLUMN server_host DROP DEFAULT;
+
+-- ALTER TABLE mix_pam ADD COLUMN server_host text NOT NULL DEFAULT '<HOST>';
+-- DROP INDEX i_mix_pam;
+-- DROP INDEX i_mix_pam_us;
+-- CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username, server_host, channel, service);
+-- CREATE INDEX i_mix_pam_us ON mix_pam (username, server_host);
+-- ALTER TABLE mix_pam ALTER COLUMN server_host DROP DEFAULT;
+
+-- ALTER TABLE route ADD COLUMN server_host text NOT NULL DEFAULT '<HOST>';
+-- DROP INDEX i_route;
+-- CREATE UNIQUE INDEX i_route ON route USING btree (domain, server_host, node, pid);
+-- ALTER TABLE i_route ALTER COLUMN server_host DROP DEFAULT;
+
+-- ALTER TABLE mqtt_pub ADD COLUMN server_host text NOT NULL DEFAULT '<HOST>';
+-- DROP INDEX i_mqtt_topic;
+-- CREATE UNIQUE INDEX i_mqtt_topic_server ON mqtt_pub (topic, server_host);
+-- ALTER TABLE mqtt_pub ALTER COLUMN server_host DROP DEFAULT;
CREATE TABLE users (