This repository has been archived on 2022-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
gosocial/pkg/models/models.go

25 lines
582 B
Go
Raw Permalink 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{})
DB.AutoMigrate(&Feedback{})
DB.AutoMigrate(&Forum{})
DB.AutoMigrate(&Thread{})
DB.AutoMigrate(&Comment{})
DB.AutoMigrate(&Like{})
DB.AutoMigrate(&Notification{})
}