Skip to content

Commit

Permalink
fixed the exported json sometimes having the wrong content
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Sep 14, 2023
1 parent 3b61036 commit 2cb858a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion server/model/cafeteria.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package model

// Cafeteria stores all Available cafeterias in the format of the eat-api
type Cafeteria struct {
Cafeteria int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteria;type:int;not null;" json:"cafeteria" `
Cafeteria int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteria;type:int;not null;" json:"canteen" `
Name string `gorm:"column:name;type:mediumtext;not null;" json:"name" `
Address string `gorm:"column:address;type:text;not null;" json:"address" `
Latitude float32 `gorm:"column:latitude;type:float;not null;" json:"latitude" `
Expand Down
4 changes: 2 additions & 2 deletions server/model/cafeteriaRating.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

// CafeteriaRating stores all Available cafeterias in the format of the eat-api
type CafeteriaRating struct {
CafeteriaRating int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRating;type:int;not null;" json:"cafeteriarating"`
CafeteriaRating int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRating;type:int;not null;" json:"canteenrating"`
Points int32 `gorm:"column:points;type:int;not null;" json:"points"`
Comment string `gorm:"column:comment;type:text;" json:"comment" `
CafeteriaID int32 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
CafeteriaID int32 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
Timestamp time.Time `gorm:"column:timestamp;type:timestamp;not null;" json:"timestamp" `
Image string `gorm:"column:image;type:text;" json:"image"`
}
Expand Down
4 changes: 2 additions & 2 deletions server/model/cafeteriaRatingAverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package model

// CafeteriaRatingAverage stores all precomputed values for the cafeteria ratings
type CafeteriaRatingAverage struct {
CafeteriaRatingAverage int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingAverage;type:int;not null;" json:"cafeteriaRatingAverage" `
CafeteriaID int32 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
CafeteriaRatingAverage int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingAverage;type:int;not null;" json:"canteenRatingAverage" `
CafeteriaID int32 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
Average float32 `gorm:"column:average;type:float;not null;" json:"average" `
Min int8 `gorm:"column:min;type:int;not null;" json:"min"`
Max int8 `gorm:"column:max;type:int;not null;" json:"max"`
Expand Down
2 changes: 1 addition & 1 deletion server/model/cafeteriaRatingTag.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package model

// CafeteriaRatingTag struct is a row record of the either the dish_tag_rating-table or the cafeteria_rating_tags-table in the database
type CafeteriaRatingTag struct {
CafeteriaRatingTag int32 `gorm:"primary_key;AUTO_INCREMENT;column:CafeteriaRatingTag;type:int;not null;" json:"CafeteriaRatingTag" `
CafeteriaRatingTag int32 `gorm:"primary_key;AUTO_INCREMENT;column:CafeteriaRatingTag;type:int;not null;" json:"CanteenRatingTag" `
CorrespondingRating int32 `gorm:"foreignKey:cafeteriaRatingID;column:correspondingRating;type:int;not null;" json:"correspondingRating"`
Points int32 `gorm:"column:points;type:int;not null;" json:"points"`
TagID int `gorm:"foreignKey:cafeteriaRatingTagOption;column:tagID;type:int;not null;" json:"tagID"`
Expand Down
6 changes: 3 additions & 3 deletions server/model/cafeteriaRatingTagAverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package model

// CafeteriaRatingTagsAverage stores all precomputed values for the cafeteria ratings
type CafeteriaRatingTagsAverage struct {
CafeteriaRatingTagsAverage int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingTagsAverage;type:int;not null;" json:"cafeteriaRatingTagsAverage" `
CafeteriaID int32 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
CafeteriaRatingTagsAverage int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingTagsAverage;type:int;not null;" json:"canteenRatingTagsAverage"`
CafeteriaID int32 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
TagID int32 `gorm:"column:tagID;foreignKey:cafeteriaRatingTagOption;type:int;not null;" json:"tagID"`
Average float32 `gorm:"column:average;type:float;not null;" json:"average" `
Average float32 `gorm:"column:average;type:float;not null;" json:"average"`
Min int8 `gorm:"column:min;type:int;not null;" json:"min"`
Max int8 `gorm:"column:max;type:int;not null;" json:"max"`
Std float32 `gorm:"column:std;type:float;not null;" json:"std"`
Expand Down
2 changes: 1 addition & 1 deletion server/model/cafeteriaRatingTagOptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package model

// CafeteriaRatingTagOption stores all available options for tags which can be used to quickly rate cafeterias
type CafeteriaRatingTagOption struct {
CafeteriaRatingsTagOption int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingTagOption;type:int;not null;" json:"cafeteriaRatingTagOption"`
CafeteriaRatingsTagOption int32 `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingTagOption;type:int;not null;" json:"canteenRatingTagOption"`
DE string `gorm:"column:DE;text;default:de;not null;" json:"DE"`
EN string `gorm:"column:EN;text;default:en;not null;" json:"EN"`
}
Expand Down

0 comments on commit 2cb858a

Please sign in to comment.