2022-08-10 05:10:47 +00:00
|
|
|
// 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{})
|
2022-08-11 03:59:59 +00:00
|
|
|
DB.AutoMigrate(&ProfileField{})
|
2022-08-12 06:03:06 +00:00
|
|
|
DB.AutoMigrate(&Photo{})
|
2022-09-08 04:18:54 +00:00
|
|
|
DB.AutoMigrate(&PrivatePhoto{})
|
2022-08-13 22:39:31 +00:00
|
|
|
DB.AutoMigrate(&CertificationPhoto{})
|
2022-08-14 00:42:42 +00:00
|
|
|
DB.AutoMigrate(&Message{})
|
2022-08-14 05:44:57 +00:00
|
|
|
DB.AutoMigrate(&Friend{})
|
2022-08-15 00:45:55 +00:00
|
|
|
DB.AutoMigrate(&Block{})
|
2022-08-21 21:05:08 +00:00
|
|
|
DB.AutoMigrate(&Feedback{})
|
2022-08-24 05:55:19 +00:00
|
|
|
DB.AutoMigrate(&Forum{})
|
|
|
|
DB.AutoMigrate(&Thread{})
|
|
|
|
DB.AutoMigrate(&Comment{})
|
2022-08-25 04:17:34 +00:00
|
|
|
DB.AutoMigrate(&Like{})
|
|
|
|
DB.AutoMigrate(&Notification{})
|
2022-08-27 18:42:48 +00:00
|
|
|
DB.AutoMigrate(&Subscription{})
|
2022-08-10 05:10:47 +00:00
|
|
|
}
|