launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #30781
[Merge] ~ines-almeida/launchpad:db-add-social-accounts-table into launchpad:db-devel
Ines Almeida has proposed merging ~ines-almeida/launchpad:db-add-social-accounts-table into launchpad:db-devel.
Commit message:
db: create new SocialAccounts table
Requested reviews:
William Grant (wgrant): db
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/457221
This is the initial step for the Matrix integration with Launchpad
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:db-add-social-accounts-table into launchpad:db-devel.
diff --git a/database/schema/patch-2211-25-0.sql b/database/schema/patch-2211-25-0.sql
new file mode 100644
index 0000000..11be02c
--- /dev/null
+++ b/database/schema/patch-2211-25-0.sql
@@ -0,0 +1,19 @@
+-- Copyright 2023 Canonical Ltd. This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+CREATE TABLE SocialAccounts (
+ id serial PRIMARY KEY,
+ person integer REFERENCES Person NOT NULL,
+ platform integer NOT NULL,
+ identifier jsonb NOT NULL
+);
+
+COMMENT ON COLUMN SocialAccounts.person IS 'Person the social media account belongs to.';
+COMMENT ON COLUMN SocialAccounts.platform IS 'Social media platform.';
+COMMENT ON COLUMN SocialAccounts.identifier IS 'Identifier for the social media account (JSON format specific per social media platform).';
+
+CREATE INDEX socialaccounts__person__idx ON SocialAccounts (person);
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2211, 25, 0);
Follow ups