From db2ab5fdc9d808bac4df4a4b4fd7370a1749f30f Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 23 Aug 2024 09:57:46 +0200 Subject: [PATCH] reverted changing Crontab table name --- server/backend/migration/20240824000000.go | 2 +- server/model/crontab.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/backend/migration/20240824000000.go b/server/backend/migration/20240824000000.go index 486d57dd..23687091 100644 --- a/server/backend/migration/20240824000000.go +++ b/server/backend/migration/20240824000000.go @@ -11,7 +11,7 @@ type wrongTableName struct { } var wrongTableNames = []wrongTableName{ - {"crontab", "crontabs"}, + //{"crontab", "crontabs"}, <- too much work for now {"kino", "movies"}, {"cafeteria", "canteens"}, {"canteen_head_count", "canteen_head_counts"}, diff --git a/server/model/crontab.go b/server/model/crontab.go index 37d8cd4d..b0709e71 100644 --- a/server/model/crontab.go +++ b/server/model/crontab.go @@ -12,3 +12,8 @@ type Crontab struct { Type null.String `gorm:"column:type;type:enum ('news','mensa','ticketsale','alarm','fileDownload','canteenHeadCount','iosNotifications','iosActivityReset','newExamResultsHook','movie','feedbackEmail','dishNameDownload','scrapeStudentClubs');" json:"type"` ID null.Int `gorm:"column:id;type:int;" json:"id"` } + +// TableName sets the insert table name for this struct type +func (n *Crontab) TableName() string { + return "crontab" +}