Answer the question
In order to leave comments, you need to log in
How to properly organize the database structure for user messages?
The following message storage structure comes to mind
type Message struct{
Id int `gorm:"primary_key"`
UserFromId int `sql:"not null"`
UserToId int `sql:"not null"`
Created string `sql:"DEFAULT:current_timestamp"`
Message string
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question