Noah Petherbridge
96e5b1abfa
Implement block lists. They work like friend lists but are unidirectional, but take effect in both directions (blocker and blockee can not see one another on the site -- except admin users can always see all users). * Profile page says 404 * User gallery says 404 * User search page filters out blocked users * Compose endpoint blocks sending messages to blocked users (except admin) * Site Gallery filters photos by blocked (and uncertified) users * Inbox page hides chat list for blocked users (can still read the chat history if you have a link to the old thread)
19 lines
414 B
Go
19 lines
414 B
Go
// Package models handles the database.
|
|
package models
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
// DB to be set by calling app (SQLite or Postgres connection).
|
|
var DB *gorm.DB
|
|
|
|
// AutoMigrate the schema.
|
|
func AutoMigrate() {
|
|
DB.AutoMigrate(&User{})
|
|
DB.AutoMigrate(&ProfileField{})
|
|
DB.AutoMigrate(&Photo{})
|
|
DB.AutoMigrate(&CertificationPhoto{})
|
|
DB.AutoMigrate(&Message{})
|
|
DB.AutoMigrate(&Friend{})
|
|
DB.AutoMigrate(&Block{})
|
|
}
|