I am creating an MVC web application that supports various types of messages between users. For example, some messages are related to RFP, while other messages are related to Invoices. And we may be asked to support other types of messages in the future.
So, the circuit I came to is still there.
Messagethread
Id int PK
Message
Id int PK
MessageThreadId int FK
UserId uniqueidentifier FK
Subject nvarchar(250)
Text nvarchar(max)
DateCreated datetime
RFPMessageThread
RFPId int PK/FK
MessageThreadId int PK/FK
InvoiceMessageThread
InvoiceId int PK/FK
MessageThreadId int PK/FK
This should work, but I doubt if this is the best route. Obviously, if I had only one type of message, I could exclude the table MessageThread.
Any suggestions, recommendations, criticisms?
source
share