add: cascade delete on messages

This commit is contained in:
trisua 2025-08-30 11:49:33 -04:00
parent 3f8171938e
commit 6b8c33d27f
2 changed files with 2 additions and 2 deletions

View file

@ -141,7 +141,7 @@ impl DataManager {
self.update_chat_last_message_read_by(data.chat, Vec::new())
.await?;
// ....
// ...
Ok(data)
}

View file

@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS t_messages (
id BIGINT NOT NULL,
created BIGINT NOT NULL,
edited BIGINT NOT NULL,
owner BIGINT NOT NULL,
owner BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
chat BIGINT NOT NULL,
content TEXT NOT NULL,
uploads TEXT NOT NULL