From 2a6e961289e8891a0ae0f067a64222502bc25eb6 Mon Sep 17 00:00:00 2001 From: dlamarcheteamnet Date: Fri, 14 Jun 2024 17:59:01 +0200 Subject: [PATCH] 54 -> 72 --- .../full_schemas/{54 => 72}/full.sql.postgres | 0 .../common/full_schemas/{54 => 72}/full.sql.sqlite | 0 .../main/delta/84/watcha_01partners_invited_by.sql | 7 +++++++ .../84/watcha_02room_mapping_with_Nextcloud.sql | 4 ++++ .../schema/main/delta/84/watcha_03is_partner.sql | 1 + .../schema/main/delta/84/watcha_05share_id.sql | 1 + .../main/delta/84/watcha_06nextcloud_username.sql | 1 + .../main/delta/84/watcha_07partners_invitations.sql | 13 +++++++++++++ .../84/watcha_08drop_directory_path_column.sql | 12 ++++++++++++ .../main/full_schemas/{54 => 72}/full.sql.postgres | 0 .../main/full_schemas/{54 => 72}/full.sql.sqlite | 0 .../state/full_schemas/{54 => 72}/full.sql.postgres | 0 .../state/full_schemas/{54 => 72}/full.sql.sqlite | 0 13 files changed, 39 insertions(+) rename synapse/storage/schema/common/full_schemas/{54 => 72}/full.sql.postgres (100%) rename synapse/storage/schema/common/full_schemas/{54 => 72}/full.sql.sqlite (100%) create mode 100644 synapse/storage/schema/main/delta/84/watcha_01partners_invited_by.sql create mode 100644 synapse/storage/schema/main/delta/84/watcha_02room_mapping_with_Nextcloud.sql create mode 100644 synapse/storage/schema/main/delta/84/watcha_03is_partner.sql create mode 100644 synapse/storage/schema/main/delta/84/watcha_05share_id.sql create mode 100644 synapse/storage/schema/main/delta/84/watcha_06nextcloud_username.sql create mode 100644 synapse/storage/schema/main/delta/84/watcha_07partners_invitations.sql create mode 100644 synapse/storage/schema/main/delta/84/watcha_08drop_directory_path_column.sql rename synapse/storage/schema/main/full_schemas/{54 => 72}/full.sql.postgres (100%) rename synapse/storage/schema/main/full_schemas/{54 => 72}/full.sql.sqlite (100%) rename synapse/storage/schema/state/full_schemas/{54 => 72}/full.sql.postgres (100%) rename synapse/storage/schema/state/full_schemas/{54 => 72}/full.sql.sqlite (100%) diff --git a/synapse/storage/schema/common/full_schemas/54/full.sql.postgres b/synapse/storage/schema/common/full_schemas/72/full.sql.postgres similarity index 100% rename from synapse/storage/schema/common/full_schemas/54/full.sql.postgres rename to synapse/storage/schema/common/full_schemas/72/full.sql.postgres diff --git a/synapse/storage/schema/common/full_schemas/54/full.sql.sqlite b/synapse/storage/schema/common/full_schemas/72/full.sql.sqlite similarity index 100% rename from synapse/storage/schema/common/full_schemas/54/full.sql.sqlite rename to synapse/storage/schema/common/full_schemas/72/full.sql.sqlite diff --git a/synapse/storage/schema/main/delta/84/watcha_01partners_invited_by.sql b/synapse/storage/schema/main/delta/84/watcha_01partners_invited_by.sql new file mode 100644 index 000000000..07f7506a1 --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_01partners_invited_by.sql @@ -0,0 +1,7 @@ +CREATE TABLE IF NOT EXISTS partners_invited_by ( + partner TEXT NOT NULL, -- The user_id created for the partner. + invited_by TEXT NOT NULL, -- The user_id of the inviter. + invitation_ts BIGINT NOT NULL, + device_id TEXT, + email_sent SMALLINT NOT NULL DEFAULT 0 +); diff --git a/synapse/storage/schema/main/delta/84/watcha_02room_mapping_with_Nextcloud.sql b/synapse/storage/schema/main/delta/84/watcha_02room_mapping_with_Nextcloud.sql new file mode 100644 index 000000000..c6ea753f7 --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_02room_mapping_with_Nextcloud.sql @@ -0,0 +1,4 @@ +CREATE TABLE IF NOT EXISTS room_nextcloud_mapping ( + room_id TEXT NOT NULL PRIMARY KEY, -- The room ID of the room which initiate a share with Nextcloud. + directory_path TEXT -- The Nextcloud directory path to share in the room. +); diff --git a/synapse/storage/schema/main/delta/84/watcha_03is_partner.sql b/synapse/storage/schema/main/delta/84/watcha_03is_partner.sql new file mode 100644 index 000000000..dcb402c9d --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_03is_partner.sql @@ -0,0 +1 @@ +ALTER TABLE users ADD COLUMN is_partner SMALLINT DEFAULT 0 NOT NULL; diff --git a/synapse/storage/schema/main/delta/84/watcha_05share_id.sql b/synapse/storage/schema/main/delta/84/watcha_05share_id.sql new file mode 100644 index 000000000..c3c4d132e --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_05share_id.sql @@ -0,0 +1 @@ +ALTER TABLE room_nextcloud_mapping ADD COLUMN share_id INTEGER; diff --git a/synapse/storage/schema/main/delta/84/watcha_06nextcloud_username.sql b/synapse/storage/schema/main/delta/84/watcha_06nextcloud_username.sql new file mode 100644 index 000000000..20b7ed55b --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_06nextcloud_username.sql @@ -0,0 +1 @@ +ALTER TABLE user_external_ids ADD COLUMN nextcloud_username TEXT; diff --git a/synapse/storage/schema/main/delta/84/watcha_07partners_invitations.sql b/synapse/storage/schema/main/delta/84/watcha_07partners_invitations.sql new file mode 100644 index 000000000..1a07ea37b --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_07partners_invitations.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS partners_invitations ( + user_id TEXT NOT NULL, + invited_by TEXT, -- The user_id of the sender. + CONSTRAINT partners_invitations_uniqueness UNIQUE (user_id, invited_by) +); + +INSERT INTO partners_invitations +SELECT DISTINCT + partner, + invited_by +FROM partners_invited_by; + +DROP TABLE partners_invited_by; \ No newline at end of file diff --git a/synapse/storage/schema/main/delta/84/watcha_08drop_directory_path_column.sql b/synapse/storage/schema/main/delta/84/watcha_08drop_directory_path_column.sql new file mode 100644 index 000000000..35bfe9b74 --- /dev/null +++ b/synapse/storage/schema/main/delta/84/watcha_08drop_directory_path_column.sql @@ -0,0 +1,12 @@ +CREATE TABLE IF NOT EXISTS watcha_nextcloud_shares ( + room_id TEXT NOT NULL PRIMARY KEY, + share_id INTEGER +); + +INSERT INTO watcha_nextcloud_shares +SELECT DISTINCT + room_id, + share_id +FROM room_nextcloud_mapping; + +DROP TABLE room_nextcloud_mapping; \ No newline at end of file diff --git a/synapse/storage/schema/main/full_schemas/54/full.sql.postgres b/synapse/storage/schema/main/full_schemas/72/full.sql.postgres similarity index 100% rename from synapse/storage/schema/main/full_schemas/54/full.sql.postgres rename to synapse/storage/schema/main/full_schemas/72/full.sql.postgres diff --git a/synapse/storage/schema/main/full_schemas/54/full.sql.sqlite b/synapse/storage/schema/main/full_schemas/72/full.sql.sqlite similarity index 100% rename from synapse/storage/schema/main/full_schemas/54/full.sql.sqlite rename to synapse/storage/schema/main/full_schemas/72/full.sql.sqlite diff --git a/synapse/storage/schema/state/full_schemas/54/full.sql.postgres b/synapse/storage/schema/state/full_schemas/72/full.sql.postgres similarity index 100% rename from synapse/storage/schema/state/full_schemas/54/full.sql.postgres rename to synapse/storage/schema/state/full_schemas/72/full.sql.postgres diff --git a/synapse/storage/schema/state/full_schemas/54/full.sql.sqlite b/synapse/storage/schema/state/full_schemas/72/full.sql.sqlite similarity index 100% rename from synapse/storage/schema/state/full_schemas/54/full.sql.sqlite rename to synapse/storage/schema/state/full_schemas/72/full.sql.sqlite