website/pkg/models/models.go

19 lines
414 B
Go
Raw Normal View History

// 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{})
2022-08-14 00:42:42 +00:00
DB.AutoMigrate(&Message{})
2022-08-14 05:44:57 +00:00
DB.AutoMigrate(&Friend{})
DB.AutoMigrate(&Block{})
}