Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(database): drop the foreign-key marker on messages.sessionId

Yudhi Armyndharis128b30f84fff
diff --git a/docs/05-database-design.md b/docs/05-database-design.md
index 6f5b162eb..e7887df68 100644
--- a/docs/05-database-design.md
+++ b/docs/05-database-design.md
@@ -248,7 +248,7 @@ erDiagram
MESSAGE {
uuid id PK
- uuid sessionId FK
+ uuid sessionId
varchar waMessageId
varchar chatId
varchar chatName
@@ -302,6 +302,8 @@ erDiagram
}
```
+`messages` and `message_batches` reference `sessions.id` through a plain `sessionId` (`session_id` on `message_batches`) with no foreign key. Deleting a session through the API removes their rows explicitly; a raw `DELETE FROM sessions` leaves them behind.
+
## 5.3 Table Specifications
> [!IMPORTANT]