Add database indexes for PostID and approval status in MediaAttachment model
This commit is contained in:
		@@ -9,13 +9,13 @@ type Post struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type Account struct {
 | 
			
		||||
	AccId          string `json:"id" gorm:"primaryKey"`
 | 
			
		||||
	Username       string `json:"username"`
 | 
			
		||||
	Acct           string `json:"acct"`
 | 
			
		||||
	DisplayName    string `json:"display_name"`
 | 
			
		||||
	IsBot          bool   `json:"bot"`
 | 
			
		||||
	Url            string `json:"url"`
 | 
			
		||||
	AvatarStatic   string `json:"avatar_static"`
 | 
			
		||||
	AccId        string `json:"id" gorm:"primaryKey"`
 | 
			
		||||
	Username     string `json:"username"`
 | 
			
		||||
	Acct         string `json:"acct"`
 | 
			
		||||
	DisplayName  string `json:"display_name"`
 | 
			
		||||
	IsBot        bool   `json:"bot"`
 | 
			
		||||
	Url          string `json:"url"`
 | 
			
		||||
	AvatarStatic string `json:"avatar_static"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type MediaAttachment struct {
 | 
			
		||||
@@ -24,7 +24,7 @@ type MediaAttachment struct {
 | 
			
		||||
	Url        string `json:"url"`
 | 
			
		||||
	PreviewUrl string `json:"preview_url"`
 | 
			
		||||
	RemoteUrl  string `json:"remote_url"`
 | 
			
		||||
	PostID     string // Foreign key to Post
 | 
			
		||||
	Approved   bool   `json:"approved"`
 | 
			
		||||
	Rejected   bool   `json:"rejected"`
 | 
			
		||||
}
 | 
			
		||||
	PostID     string `gorm:"index:idx_post_approved"` // Foreign key to Post
 | 
			
		||||
	Approved   bool   `json:"approved" gorm:"index:idx_post_approved"`
 | 
			
		||||
	Rejected   bool   `json:"rejected" gorm:"index:idx_post_rejected"`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user