fetching mailboxes from api

This commit is contained in:
grimhilt
2023-03-17 13:31:27 +01:00
parent 6b96815b93
commit ace2063309
24 changed files with 3107 additions and 603 deletions

View File

@@ -35,7 +35,6 @@ CREATE TABLE mailbox (
first_recent INT NOT NULL DEFAULT 1,
uidvalidity INT NOT NULL DEFAULT 1,
PRIMARY KEY (mailbox_id),
UNIQUE KEY (mailbox_name),
FOREIGN KEY (account_id) REFERENCES app_account(account_id) ON DELETE CASCADE
);
@@ -121,11 +120,13 @@ CREATE TABLE app_room (
room_id INT AUTO_INCREMENT,
room_name VARCHAR(255) NOT NULL,
owner_id INT NOT NULL,
message_id INT NOT NULL,
isGroup BOOLEAN NOT NULL DEFAULT false,
notSeen INT NOT NULL DEFAULT 0,
lastUpdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
PRIMARY KEY (room_id),
FOREIGN KEY (owner_id) REFERENCES address(address_id)
FOREIGN KEY (owner_id) REFERENCES address(address_id),
FOREIGN KEY (message_id) REFERENCES message(message_id)
);
-- 12
@@ -145,7 +146,7 @@ CREATE TABLE app_space_message (
message_id INT NOT NULL,
room_id INT,
thread_id INT,
UNIQUE KEY (member_id, room_id, thread_id),
UNIQUE KEY (message_id, room_id, thread_id),
FOREIGN KEY (message_id) REFERENCES message(message_id) ON DELETE CASCADE,
FOREIGN KEY (room_id) REFERENCES app_room(room_id) ON DELETE SET NULL,
FOREIGN KEY (thread_id) REFERENCES app_thread(thread_id) ON DELETE SET NULL