1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Introduce entity aliases (unfinished).

This commit is contained in:
Ferdinand Mütsch
2019-07-06 17:53:20 +02:00
parent e23e7520d0
commit 37ec6c62fc
6 changed files with 77 additions and 5 deletions

View File

@@ -88,6 +88,7 @@ func main() {
// Migrate database schema
db.AutoMigrate(&models.User{})
db.AutoMigrate(&models.Alias{})
db.AutoMigrate(&models.Heartbeat{}).AddForeignKey("user_id", "users(id)", "RESTRICT", "RESTRICT")
// Custom migrations and initial data
@@ -95,9 +96,10 @@ func main() {
migrateLanguages(db, config)
// Services
aliasSrvc := &services.AliasService{config, db}
heartbeatSrvc := &services.HeartbeatService{config, db}
userSrvc := &services.UserService{config, db}
summarySrvc := &services.SummaryService{config, db, heartbeatSrvc}
summarySrvc := &services.SummaryService{config, db, heartbeatSrvc, aliasSrvc}
// Handlers
heartbeatHandler := &routes.HeartbeatHandler{HeartbeatSrvc: heartbeatSrvc}