generated from t/malachite
add: cascade delete on messages
This commit is contained in:
parent
3f8171938e
commit
6b8c33d27f
2 changed files with 2 additions and 2 deletions
|
@ -141,7 +141,7 @@ impl DataManager {
|
||||||
self.update_chat_last_message_read_by(data.chat, Vec::new())
|
self.update_chat_last_message_read_by(data.chat, Vec::new())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// ....
|
// ...
|
||||||
Ok(data)
|
Ok(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS t_messages (
|
||||||
id BIGINT NOT NULL,
|
id BIGINT NOT NULL,
|
||||||
created BIGINT NOT NULL,
|
created BIGINT NOT NULL,
|
||||||
edited 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,
|
chat BIGINT NOT NULL,
|
||||||
content TEXT NOT NULL,
|
content TEXT NOT NULL,
|
||||||
uploads TEXT NOT NULL
|
uploads TEXT NOT NULL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue