17 lines
361 B
Go
17 lines
361 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{})
|
|
}
|