Skip to content

Commit

Permalink
feat(migrate-legalhold-database-to-support-qualified-ids)
Browse files Browse the repository at this point in the history
* Update LegalHold version to v1.1.0
* Update Dropwizard version to 2.1.12
* Adjust EventsDAO and AccessDAO queries to use ID and Domain
* Adjust DAO query usages on ConversationResource and EventsResource
* Change HoldWireClient to receive QualifiedID instead of UUID
* From MessageHandler persist correct values of Conversation and User with qualified Ids
* Remove last TODO for adding qualified domain
* Comment decision on removing PRIMARY KEY and adding UNIQUE to Access DB table
  • Loading branch information
alexandreferris committed Oct 14, 2024
1 parent 95156e4 commit 2d6e7c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/wire/bots/hold/utils/Collector.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void addSystem(String text, String dateTime, String type) throws ParseExc

private Sender sender(User user, Message message) {
Sender sender = new Sender();
sender.senderId = user.id;
sender.senderId = user.id.toString();
sender.name = user.name;
sender.accent = toColor(user.accent);
sender.avatar = getAvatar(user);
Expand All @@ -79,7 +79,7 @@ private Sender sender(User user, Message message) {
private Sender system(Message message, String type) {
Sender sender = new Sender();
sender.system = "system";
sender.senderId = new QualifiedId(UUID.randomUUID(), null); // TODO(WPB-11287): Change null to default domain
sender.senderId = "system";
sender.avatar = systemIcon(type);
sender.messages.add(message);
return sender;
Expand Down Expand Up @@ -213,7 +213,7 @@ public static class Message {
}

public static class Sender {
QualifiedId senderId;
String senderId;
String avatar;
String name;
String accent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ALTER TABLE Access
ADD COLUMN userDomain VARCHAR(255) DEFAULT null;

-- Dropping the PRIMARY KEY and adding a UNIQUE constraint with both Id and Domain,
-- because Postgresql doesn't like a nullable fields being PRIMARY KEY.
-- (previous tentative: PRIMARY KEY (userId, userDomain)
ALTER TABLE Access
DROP CONSTRAINT IF EXISTS access_pkey;

Expand Down

0 comments on commit 2d6e7c0

Please sign in to comment.