website/pkg/models/models.go
Noah aa8d719fc4 Comment Thread Subscriptions
* Add ability to (un)subscribe from comment threads on Forums and Photos.
* Creating a forum post, replying to a post or adding a comment to a photo
  automatically subscribes you to be notified when somebody else adds a
  comment to the thing later.
* At the top of each comment thread is a link to disable or re-enable your
  subscription. You can join a subscription without even needing to comment.
  If you click to disable notifications, they stay disabled even if you
  add another comment later.
2022-08-27 11:42:48 -07:00

26 lines
615 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{})
DB.AutoMigrate(&Feedback{})
DB.AutoMigrate(&Forum{})
DB.AutoMigrate(&Thread{})
DB.AutoMigrate(&Comment{})
DB.AutoMigrate(&Like{})
DB.AutoMigrate(&Notification{})
DB.AutoMigrate(&Subscription{})
}