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-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-10 05:10:47 +00:00
|
|
|
}
|