From 93bf4d5411137cc48a51464487236938f039b113 Mon Sep 17 00:00:00 2001 From: Stu Tomlinson Date: Thu, 17 Nov 2022 12:03:09 +0000 Subject: [PATCH] New SQL schema migrate fix 'server_host' column on 'route' table already exists in old schema and does not need adding for new schema migration. --- sql/pg.new.sql | 5 ----- src/mod_admin_update_sql.erl | 5 ----- 2 files changed, 10 deletions(-) diff --git a/sql/pg.new.sql b/sql/pg.new.sql index de1c28a2e..4a742756d 100644 --- a/sql/pg.new.sql +++ b/sql/pg.new.sql @@ -170,11 +170,6 @@ -- 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 ''; --- 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 ''; -- DROP INDEX i_mqtt_topic; -- CREATE UNIQUE INDEX i_mqtt_topic_server ON mqtt_pub (topic, server_host); diff --git a/src/mod_admin_update_sql.erl b/src/mod_admin_update_sql.erl index adcc5b117..3a6aa0dfb 100644 --- a/src/mod_admin_update_sql.erl +++ b/src/mod_admin_update_sql.erl @@ -271,11 +271,6 @@ update_tables(State) -> create_index(State, "mix_pam", "i_mix_pam_us", ["username", "server_host"]), drop_sh_default(State, "mix_pam"), - add_sh_column(State, "route"), - drop_index(State, "i_route"), - create_unique_index(State, "route", "i_route", ["domain", "server_host", "node", "pid"]), - drop_sh_default(State, "route"), - add_sh_column(State, "mqtt_pub"), drop_index(State, "i_mqtt_topic"), create_unique_index(State, "mqtt_pub", "i_mqtt_topic_server", ["topic", "server_host"]),