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-10-21 04:02:30 +00:00
|
|
|
DB.AutoMigrate(&CommentPhoto{})
|
2022-12-15 06:57:06 +00:00
|
|
|
DB.AutoMigrate(&Poll{})
|
2022-12-21 03:15:45 +00:00
|
|
|
DB.AutoMigrate(&PollVote{})
|
2023-08-02 03:39:48 +00:00
|
|
|
DB.AutoMigrate(&AdminGroup{})
|
|
|
|
DB.AutoMigrate(&AdminScope{})
|
2023-08-20 02:11:33 +00:00
|
|
|
DB.AutoMigrate(&UserLocation{})
|
2023-09-16 20:46:26 +00:00
|
|
|
DB.AutoMigrate(&UserNote{})
|
2022-08-10 05:10:47 +00:00
|
|
|
}
|