Documentation
¶
Overview ¶
Package migration contains functions related to database changes and executes them
Index ¶
- Constants
- func BuildEnum(types []string) string
- func EnumTypesFromString(enum string) ([]string, error)
- func Migrate(db *gorm.DB) error
- func MigrateFromBaseline(db *gorm.DB) error
- func Models() []any
- func RemoveTypes(types []string, rollbackTypes ...string) []string
- func SafeEnumAdd(tx *gorm.DB, table interface{}, column string, additionalTypes ...string) error
- func SafeEnumRemove(tx *gorm.DB, table interface{}, column string, rollbackTypes ...string) error
- type CafeteriaRatingAverage
- type CafeteriaRatingTagsAverage
- type DishNameTagAverage
- type DishRatingAverage
- type DishRatingTagAverage
- type Feedback
- type File
- type IOSDevice
- type IOSDeviceRequestLog
- type IOSDevicesActivityReset
- type IOSEncryptedGrade
- type IOSScheduledUpdateLog
- type IOSSchedulingPriority
- type InitialCafeteria
- type InitialCafeteriaRating
- type InitialCafeteriaRatingAverage
- type InitialCafeteriaRatingTag
- type InitialCafeteriaRatingTagAverage
- type InitialCafeteriaRatingTagOption
- type InitialCanteenHeadCount
- type InitialDish
- type InitialDishNameTag
- type InitialDishNameTagAverage
- type InitialDishNameTagOption
- type InitialDishNameTagOptionExcluded
- type InitialDishNameTagOptionIncluded
- type InitialDishRating
- type InitialDishRatingAverage
- type InitialDishRatingTag
- type InitialDishRatingTagAverage
- type InitialDishRatingTagOption
- type InitialDishToDishNameTag
- type InitialDishesOfTheWeek
- type InitialIOSDevice
- type InitialIOSDeviceRequestLog
- type InitialIOSDevicesActivityReset
- type InitialIOSEncryptedGrade
- type InitialIOSScheduledUpdateLog
- type InitialIOSSchedulingPriority
- type InitialStudentClub
- type InitialStudentClubCollection
- type KinoWithNullableFields
- type KinoWithoutNullableFields
- type NewExamResultsSubscriber
- type NewsSource
- type NewsSourceFile
- type PublishedExamResult
- type RoomfinderBuilding2area
- type RoomfinderBuildings
- type RoomfinderBuildings2gps
- type RoomfinderBuildings2maps
- type RoomfinderRooms
- type RoomfinderRooms2maps
- type ToFillCafeteriaRatingTagOption
- type ToFillDishNameTagOption
- type ToFillDishNameTagOptionExcluded
- type ToFillDishNameTagOptionIncluded
- type ToFillDishRatingTagOption
Constants ¶
const TableOptions = "ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
TableOptions are the options every table is created with. Without them, the `COLLATE` will not be set correctly.
Variables ¶
This section is empty.
Functions ¶
func EnumTypesFromString ¶
func Migrate ¶
Migrate brings the database to the latest schema by running the legacy migrations followed by the Atlas-generated SQL migrations. Applied migrations are tracked in the `migrations` table.
func MigrateFromBaseline ¶
MigrateFromBaseline creates the latest schema on an empty database from the Atlas baseline snapshot plus the SQL migrations after it.
It produces the same schema as Migrate, but skips the legacy migrations (and the seed data they insert) and does not record anything in the `migrations` table. It is much faster than Migrate and meant for tests.
func Models ¶
func Models() []any
Models returns all models whose schema is managed by migrations. It is shared by AutoMigrate and the Atlas schema loader (tools/atlasloader).
func RemoveTypes ¶
func SafeEnumAdd ¶
Types ¶
type CafeteriaRatingAverage ¶
type CafeteriaRatingAverage struct {
CafeteriaRatingAverage int64 `gorm:"primary_key;autoIncrement;column:cafeteriaRatingAverage;type:int;not null;"`
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;"`
Average float64 `gorm:"column:average;type:double;not null;"`
Min int32 `gorm:"column:min;type:int;not null;"`
Max int32 `gorm:"column:max;type:int;not null;"`
Std float64 `gorm:"column:std;type:double;not null;"`
}
CafeteriaRatingAverage stores all precomputed values for the cafeteria ratings
func (*CafeteriaRatingAverage) TableName ¶
func (n *CafeteriaRatingAverage) TableName() string
TableName sets the insert table name for this struct type
type CafeteriaRatingTagsAverage ¶
type CafeteriaRatingTagsAverage struct {
CafeteriaRatingTagsAverage int64 `gorm:"primary_key;autoIncrement;column:cafeteriaRatingTagsAverage;type:int;not null;" json:"canteenRatingTagsAverage"`
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
TagID int64 `gorm:"column:tagID;foreignKey:cafeteriaRatingTagOption;type:int;not null;" json:"tagID"`
Average float64 `gorm:"column:average;type:double;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 float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
CafeteriaRatingTagsAverage stores all precomputed values for the cafeteria ratings
func (*CafeteriaRatingTagsAverage) TableName ¶
func (n *CafeteriaRatingTagsAverage) TableName() string
TableName sets the insert table name for this struct type
type DishNameTagAverage ¶
type DishNameTagAverage struct {
DishNameTagAverage int64 `gorm:"primary_key;autoIncrement;column:dishNameTagAverage;type:int;not null;" json:"dishNameTagAverage" `
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
TagID int64 `gorm:"column:tagID;foreignKey:DishNameTagOption;type:int;not null;" json:"tagID"`
Average float64 `gorm:"column:average;type:double;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 float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
DishNameTagAverage stores all precomputed values for the DishName ratings
func (*DishNameTagAverage) TableName ¶
func (n *DishNameTagAverage) TableName() string
TableName sets the insert table name for this struct type
type DishRatingAverage ¶
type DishRatingAverage struct {
DishRatingAverage int64 `gorm:"primary_key;autoIncrement;column:dishRatingAverage;type:int;not null;"`
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;"`
DishID int64 `gorm:"column:dishID;foreignKey:dish;type:int;not null;"`
Average float64 `gorm:"column:average;type:double;not null;"`
Min int32 `gorm:"column:min;type:int;not null;"`
Max int32 `gorm:"column:max;type:int;not null;"`
Std float64 `gorm:"column:std;type:double;not null;"`
}
DishRatingAverage stores all precomputed values for the cafeteria ratings
func (*DishRatingAverage) TableName ¶
func (n *DishRatingAverage) TableName() string
TableName sets the insert table name for this struct type
type DishRatingTagAverage ¶
type DishRatingTagAverage struct {
DishRatingTagsAverage int64 `gorm:"primary_key;autoIncrement;column:dishRatingTagsAverage;type:int;not null;"`
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;"`
TagID int64 `gorm:"column:tagID;foreignKey:tagID;type:int;not null;"`
DishID int64 `gorm:"column:dishID;foreignKey:dishID;type:int;not null;"`
Average float64 `gorm:"column:average;type:double;not null;"`
Min int8 `gorm:"column:min;type:int;not null;"`
Max int8 `gorm:"column:max;type:int;not null;"`
Std float64 `gorm:"column:std;type:double;not null;"`
}
DishRatingTagAverage stores all precomputed values for the cafeteria ratings
func (*DishRatingTagAverage) TableName ¶
func (n *DishRatingTagAverage) TableName() string
TableName sets the insert table name for this struct type
type Feedback ¶
type File ¶
type File struct {
File int64 `gorm:"primary_key;autoIncrement;column:file;type:int;" json:"file"`
Name string `gorm:"column:name;type:text;size:16777215;" json:"name"`
Path string `gorm:"column:path;type:text;size:16777215;" json:"path"`
Downloads int32 `gorm:"column:downloads;type:int;default:0;not null;" json:"downloads"`
URL null.String `gorm:"column:url;default:null;" json:"url"` // URL of the files source (if any)
Downloaded null.Bool `gorm:"column:downloaded;type:boolean;default:1;" json:"downloaded"` // true when file is ready to be served, false when still being downloaded
}
type IOSDevice ¶
type IOSDevice struct {
DeviceID string `gorm:"primary_key"`
CreatedAt time.Time `gorm:"autoCreateTime"`
PublicKey string `gorm:"not null"`
ActivityToday int32 `gorm:"default:0"`
ActivityThisWeek int32 `gorm:"default:0"`
ActivityThisMonth int32 `gorm:"default:0"`
ActivityThisYear int32 `gorm:"default:0"`
}
IOSDevice stores relevant device information. E.g. the PublicKey which is used to encrypt push notifications The DeviceID can be used to send push notifications via APNs
type IOSDeviceRequestLog ¶
type IOSDeviceRequestLog struct {
RequestID string `gorm:"primary_key;default:UUID()"`
DeviceID string `gorm:"size:200;not null"`
Device IOSDevice `gorm:"constraint:OnDelete:CASCADE;"`
RequestType string `gorm:"not null;type:enum ('CAMPUS_TOKEN_REQUEST');"`
CreatedAt time.Time `gorm:"autoCreateTime"`
}
An IOSDeviceRequestLog is created when the backend wants to request data from the device.
1. The backend creates a new IOSDeviceRequestLog
2. The backend sends a background push notification to the device containing the RequestID of the IOSDeviceRequestLog.
3. The device receives the push notification and sends a request to the backend containing the RequestID and the data.
type IOSDevicesActivityReset ¶
type IOSEncryptedGrade ¶
type IOSEncryptedGrade struct {
ID int64 `gorm:"primaryKey"`
Device IOSDevice `gorm:"constraint:OnDelete:CASCADE"`
DeviceID string `gorm:"index;not null"`
LectureTitle string `gorm:"not null"`
Grade string `gorm:"not null"`
IsEncrypted bool `gorm:"not null,default:true"`
}
IOSEncryptedGrade is a grade that can be encrypted. Whether it is currently encrypted or not is indicated by the IsEncrypted field.
type IOSScheduledUpdateLog ¶
type IOSScheduledUpdateLog struct {
ID int64 `gorm:"primary_key;auto_increment;not_null"`
DeviceID string `gorm:"index:idx_scheduled_update_log_device,unique"`
Device IOSDevice `gorm:"constraint:OnDelete:CASCADE;"`
Type string `gorm:"type:enum ('grades');"`
CreatedAt time.Time `gorm:"index:idx_scheduled_update_log_created,unique;autoCreateTime"`
}
IOSScheduledUpdateLog logs the last time a device was updated.
type IOSSchedulingPriority ¶
type IOSSchedulingPriority struct {
ID int64 `gorm:"primary_key;auto_increment;not_null" json:"id"`
FromDay int `gorm:"not null" json:"from_day"`
ToDay int `gorm:"not null" json:"to_day"`
FromHour int `gorm:"not null" json:"from_hour"`
ToHour int `gorm:"not null" json:"to_hour"`
Priority int `gorm:"not null" json:"priority"`
}
IOSSchedulingPriority stores some default priorities for the scheduling of grade updates.
type InitialCafeteria ¶
type InitialCafeteria struct {
Cafeteria int64 `gorm:"primary_key;autoIncrement;column:cafeteria;type:int;not null;" json:"canteen" `
Name string `gorm:"column:name;type:text;not null;" json:"name" `
Address string `gorm:"column:address;type:text;not null;" json:"address" `
Latitude float64 `gorm:"column:latitude;type:double;not null;" json:"latitude" `
Longitude float64 `gorm:"column:longitude;type:double;not null;" json:"longitude"`
}
InitialCafeteria stores all Available cafeterias in the format of the eat-api
func (*InitialCafeteria) TableName ¶
func (n *InitialCafeteria) TableName() string
TableName sets the insert table name for this struct type
type InitialCafeteriaRating ¶
type InitialCafeteriaRating struct {
CafeteriaRating int64 `gorm:"primary_key;autoIncrement;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 int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
Timestamp time.Time `gorm:"column:timestamp;type:timestamp;not null;default:current_timestamp();OnUpdate:current_timestamp();" json:"timestamp" `
Image string `gorm:"column:image;type:text;" json:"image"`
}
InitialCafeteriaRating stores all Available cafeterias in the format of the eat-api
func (*InitialCafeteriaRating) TableName ¶
func (n *InitialCafeteriaRating) TableName() string
TableName sets the insert table name for this struct type
type InitialCafeteriaRatingAverage ¶
type InitialCafeteriaRatingAverage struct {
CafeteriaRatingAverage int64 `gorm:"primary_key;autoIncrement;column:cafeteriaRatingAverage;type:int;not null;" json:"canteenRatingAverage" `
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
Average float64 `gorm:"column:average;type:double;not null;" json:"average" `
Min int32 `gorm:"column:min;type:int;not null;" json:"min"`
Max int32 `gorm:"column:max;type:int;not null;" json:"max"`
Std float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
InitialCafeteriaRatingAverage stores all precomputed values for the cafeteria ratings
func (*InitialCafeteriaRatingAverage) TableName ¶
func (n *InitialCafeteriaRatingAverage) TableName() string
TableName sets the insert table name for this struct type
type InitialCafeteriaRatingTag ¶
type InitialCafeteriaRatingTag struct {
CafeteriaRatingTag int64 `gorm:"primary_key;autoIncrement;column:CafeteriaRatingTag;type:int;not null;"`
CorrespondingRating int64 `gorm:"foreignKey:cafeteriaRatingID;column:correspondingRating;type:int;not null;"`
Points int32 `gorm:"column:points;type:int;not null;"`
TagID int64 `gorm:"foreignKey:cafeteriaRatingTagOption;column:tagID;type:int;not null;"`
}
InitialCafeteriaRatingTag struct is a row record of the either the dish_tag_rating-table or the cafeteria_rating_tags-table in the database
func (*InitialCafeteriaRatingTag) TableName ¶
func (n *InitialCafeteriaRatingTag) TableName() string
TableName sets the insert table name for this struct type
type InitialCafeteriaRatingTagAverage ¶
type InitialCafeteriaRatingTagAverage struct {
CafeteriaRatingTagsAverage int64 `gorm:"primary_key;autoIncrement;column:cafeteriaRatingTagsAverage;type:int;not null;" json:"canteenRatingTagsAverage"`
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"canteenID"`
TagID int64 `gorm:"column:tagID;foreignKey:cafeteriaRatingTagOption;type:int;not null;" json:"tagID"`
Average float64 `gorm:"column:average;type:double;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 float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
InitialCafeteriaRatingTagAverage stores all precomputed values for the cafeteria ratings
func (*InitialCafeteriaRatingTagAverage) TableName ¶
func (n *InitialCafeteriaRatingTagAverage) TableName() string
TableName sets the insert table name for this struct type
type InitialCafeteriaRatingTagOption ¶
type InitialCafeteriaRatingTagOption struct {
CafeteriaRatingsTagOption int64 `gorm:"primary_key;autoIncrement;column:cafeteriaRatingTagOption;type:int;not null;"`
DE string `gorm:"column:DE;text;default:('de');not null;"`
EN string `gorm:"column:EN;text;default:('en');not null;"`
}
InitialCafeteriaRatingTagOption stores all available options for tags which can be used to quickly rate cafeterias
func (*InitialCafeteriaRatingTagOption) TableName ¶
func (n *InitialCafeteriaRatingTagOption) TableName() string
TableName sets the insert table name for this struct type
type InitialCanteenHeadCount ¶
type InitialCanteenHeadCount struct {
CanteenId string `gorm:"primary_key;column:canteen_id;type:varchar(64);not null;" json:"canteen_id"`
Count uint32 `gorm:"column:count;type:int;not null;" json:"count"`
MaxCount uint32 `gorm:"column:max_count;type:int;not null;" json:"max_count"`
Percent float32 `gorm:"column:percent;type:float;not null;" json:"percent"`
Timestamp time.Time `gorm:"column:timestamp;type:timestamp;not null;default:current_timestamp();OnUpdate:current_timestamp();" json:"timestamp" `
}
InitialCanteenHeadCount stores all available people counts for available canteens. The CanteenId represents the same ID, as for the canteen inside the eat-api.
func (*InitialCanteenHeadCount) TableName ¶
func (n *InitialCanteenHeadCount) TableName() string
TableName sets the insert table name for this struct type
type InitialDish ¶
type InitialDish struct {
Dish int64 `gorm:"primary_key;autoIncrement;column:dish;type:int;not null;" json:"dish"`
Name string `gorm:"column:name;type:text;not null;" json:"name" `
Type string `gorm:"column:type;type:text;not null;" json:"type" `
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
}
InitialDish represents one dish fin a specific cafeteria
func (*InitialDish) TableName ¶
func (n *InitialDish) TableName() string
TableName sets the insert table name for this struct type
type InitialDishNameTag ¶
type InitialDishNameTag struct {
DishNameTag int64 `gorm:"primary_key;autoIncrement;column:DishNameTag;type:int;not null;" json:"DishNameTag"`
CorrespondingRating int64 `gorm:"foreignKey:dish;column:correspondingRating;type:int;not null;" json:"correspondingRating"`
Points int32 `gorm:"column:points;type:int;not null;" json:"points"`
TagNameID int64 `gorm:"foreignKey:tagRatingID;column:tagNameID;type:int;not null;" json:"tagnameID"`
}
func (*InitialDishNameTag) TableName ¶
func (n *InitialDishNameTag) TableName() string
TableName sets the insert table name for this struct type
type InitialDishNameTagAverage ¶
type InitialDishNameTagAverage struct {
DishNameTagAverage int64 `gorm:"primary_key;autoIncrement;column:dishNameTagAverage;type:int;not null;" json:"dishNameTagAverage" `
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
TagID int64 `gorm:"column:tagID;foreignKey:DishNameTagOption;type:int;not null;" json:"tagID"`
Average float64 `gorm:"column:average;type:double;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 float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
InitialDishNameTagAverage stores all precomputed values for the DishName ratings
func (*InitialDishNameTagAverage) TableName ¶
func (n *InitialDishNameTagAverage) TableName() string
TableName sets the insert table name for this struct type
type InitialDishNameTagOption ¶
type InitialDishNameTagOption struct {
DishNameTagOption int64 `gorm:"primary_key;autoIncrement;column:dishNameTagOption;type:int;not null;" json:"dishNameTagOption"`
DE string `gorm:"column:DE;type:text;not null;" json:"DE"`
EN string `gorm:"column:EN;type:text;not null;" json:"EN"`
}
func (*InitialDishNameTagOption) TableName ¶
func (n *InitialDishNameTagOption) TableName() string
TableName sets the insert table name for this struct type
type InitialDishNameTagOptionExcluded ¶
type InitialDishNameTagOptionExcluded struct {
DishNameTagOptionExcluded int64 `gorm:"primary_key;autoIncrement;column:dishNameTagOptionExcluded;type:int;not null;" json:"dishNameTagOptionExcluded"`
NameTagID int64 `gorm:"foreignKey:dishNameTagOption;column:nameTagID;type:int;not null;" json:"nameTagID"`
Expression string `gorm:"column:expression;type:text;" json:"expression"`
}
func (*InitialDishNameTagOptionExcluded) TableName ¶
func (n *InitialDishNameTagOptionExcluded) TableName() string
TableName sets the insert table name for this struct type
type InitialDishNameTagOptionIncluded ¶
type InitialDishNameTagOptionIncluded struct {
DishNameTagOptionIncluded int64 `gorm:"primary_key;autoIncrement;column:dishNameTagOptionIncluded;type:int;not null;" json:"dishNameTagOptionIncluded"`
NameTagID int64 `gorm:"foreignKey:dishNameTagOption;column:nameTagID;type:int;not null;" json:"nameTagID"`
Expression string `gorm:"column:expression;type:text;" json:"expression"`
}
func (*InitialDishNameTagOptionIncluded) TableName ¶
func (n *InitialDishNameTagOptionIncluded) TableName() string
TableName sets the insert table name for this struct type
type InitialDishRating ¶
type InitialDishRating struct {
DishRating int64 `gorm:"primary_key;autoIncrement;column:dishRating;type:int;not null;" json:"dishRating"`
Points int32 `gorm:"column:points;type:int;not null;" json:"points"`
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
DishID int64 `gorm:"column:dishID;foreignKey:dish;type:int;not null;" json:"dishID"`
Comment string `gorm:"column:comment;type:text;" json:"comment"`
Timestamp time.Time `gorm:"column:timestamp;type:timestamp;not null;default:current_timestamp();OnUpdate:current_timestamp();" json:"timestamp"`
Image string `gorm:"column:image;type:text;" json:"image"`
}
func (*InitialDishRating) TableName ¶
func (n *InitialDishRating) TableName() string
TableName sets the insert table name for this struct type
type InitialDishRatingAverage ¶
type InitialDishRatingAverage struct {
DishRatingAverage int64 `gorm:"primary_key;autoIncrement;column:dishRatingAverage;type:int;not null;" json:"dishRatingAverage" `
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
DishID int64 `gorm:"column:dishID;foreignKey:dish;type:int;not null;" json:"dishID"`
Average float64 `gorm:"column:average;type:double;not null;" json:"average" `
Min int32 `gorm:"column:min;type:int;not null;" json:"min"`
Max int32 `gorm:"column:max;type:int;not null;" json:"max"`
Std float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
InitialDishRatingAverage stores all precomputed values for the cafeteria ratings
func (*InitialDishRatingAverage) TableName ¶
func (n *InitialDishRatingAverage) TableName() string
TableName sets the insert table name for this struct type
type InitialDishRatingTag ¶
type InitialDishRatingTag struct {
DishRatingTag int64 `gorm:"primary_key;autoIncrement;column:dishRatingTag;type:int;not null;" json:"dishRatingTag"`
CorrespondingRating int64 `gorm:"foreignKey:cafeteriaRating;column:parentRating;type:int;not null;" json:"parentRating"`
Points int32 `gorm:"column:points;type:int;not null;" json:"points"`
TagID int64 `gorm:"foreignKey:dishRatingTagOption;column:tagID;type:int;not null;" json:"tagID"`
}
func (*InitialDishRatingTag) TableName ¶
func (n *InitialDishRatingTag) TableName() string
TableName sets the insert table name for this struct type
type InitialDishRatingTagAverage ¶
type InitialDishRatingTagAverage struct {
DishRatingTagsAverage int64 `gorm:"primary_key;autoIncrement;column:dishRatingTagsAverage;type:int;not null;" json:"dishRatingTagsAverage" `
CafeteriaID int64 `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;" json:"cafeteriaID"`
TagID int64 `gorm:"column:tagID;foreignKey:tagID;type:int;not null;" json:"tagID"`
DishID int64 `gorm:"column:dishID;foreignKey:dishID;type:int;not null;" json:"dishID"`
Average float64 `gorm:"column:average;type:double;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 float64 `gorm:"column:std;type:double;not null;" json:"std"`
}
InitialDishRatingTagAverage stores all precomputed values for the cafeteria ratings
func (*InitialDishRatingTagAverage) TableName ¶
func (n *InitialDishRatingTagAverage) TableName() string
TableName sets the insert table name for this struct type
type InitialDishRatingTagOption ¶
type InitialDishRatingTagOption struct {
DishRatingTagOption int64 `gorm:"primary_key;autoIncrement;column:dishRatingTagOption;type:int;not null;" json:"dishRatingTagOption"`
DE string `gorm:"column:DE;type:text;default:('de');not null;" json:"DE"`
EN string `gorm:"column:EN;type:text;default:('en');not null;" json:"EN"`
}
func (*InitialDishRatingTagOption) TableName ¶
func (n *InitialDishRatingTagOption) TableName() string
TableName sets the insert table name for this struct type
type InitialDishToDishNameTag ¶
type InitialDishToDishNameTag struct {
DishToDishNameTag int64 `gorm:"primary_key;autoIncrement;column:dishToDishNameTag;type:int;not null;" json:"dishToDishNameTag"`
DishID int64 `gorm:"column:dishID;foreignKey:dish;type:int;not null;" json:"dishID"`
NameTagID int64 `gorm:"foreignKey:dishNameTagOption;column:nameTagID;type:int;not null;" json:"nameTagID"`
}
func (*InitialDishToDishNameTag) TableName ¶
func (n *InitialDishToDishNameTag) TableName() string
TableName sets the insert table name for this struct type
type InitialDishesOfTheWeek ¶
type InitialDishesOfTheWeek struct {
DishesOfTheWeek int64 `gorm:"primary_key;autoIncrement;column:dishesOfTheWeek;type:int;not null;" json:"dishesOfTheWeek"`
Year int32 `gorm:"column:year;type:int;not null;" json:"year"`
Week int32 `gorm:"column:week;type:int;not null;" json:"week"`
Day int32 `gorm:"column:day;type:int;not null;" json:"day"`
DishID int64 `gorm:"column:dishID;foreignKey:dish;type:int;not null;" json:"dishID"`
}
func (*InitialDishesOfTheWeek) TableName ¶
func (n *InitialDishesOfTheWeek) TableName() string
TableName sets the insert table name for this struct type
type InitialIOSDevice ¶
type InitialIOSDevice struct {
DeviceID string `gorm:"primary_key" json:"deviceId"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"createdAt"`
PublicKey string `gorm:"not null" json:"publicKey"`
ActivityToday int32 `gorm:"default:0" json:"activityToday"`
ActivityThisWeek int32 `gorm:"default:0" json:"activityThisWeek"`
ActivityThisMonth int32 `gorm:"default:0" json:"activityThisMonth"`
ActivityThisYear int32 `gorm:"default:0" json:"activityThisYear"`
}
func (*InitialIOSDevice) TableName ¶
func (n *InitialIOSDevice) TableName() string
TableName sets the insert table name for this struct type
type InitialIOSDeviceRequestLog ¶
type InitialIOSDeviceRequestLog struct {
RequestID string `gorm:"type:char(36);primary_key;default:(UUID())" json:"requestId"`
DeviceID string `gorm:"size:200;not null" json:"deviceId"`
Device InitialIOSDevice `gorm:"constraint:OnDelete:CASCADE;" json:"device"`
RequestType string `gorm:"not null;type:enum ('CAMPUS_TOKEN_REQUEST');" json:"requestType"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"createdAt"`
}
func (*InitialIOSDeviceRequestLog) TableName ¶
func (p *InitialIOSDeviceRequestLog) TableName() string
TableName sets the insert table name for this struct type
type InitialIOSDevicesActivityReset ¶
type InitialIOSDevicesActivityReset struct {
Type string `gorm:"primary_key;type:enum('day', 'week', 'month', 'year')"`
LastReset time.Time `gorm:"autoCreateTime"`
}
func (*InitialIOSDevicesActivityReset) TableName ¶
func (p *InitialIOSDevicesActivityReset) TableName() string
TableName sets the insert table name for this struct type
type InitialIOSEncryptedGrade ¶
type InitialIOSEncryptedGrade struct {
ID int64 `gorm:"primaryKey"`
Device InitialIOSDevice `gorm:"constraint:OnDelete:CASCADE"`
DeviceID string `gorm:"index;not null"`
LectureTitle string `gorm:"not null"`
Grade string `gorm:"not null"`
IsEncrypted bool `gorm:"not null,default:true"`
}
func (*InitialIOSEncryptedGrade) TableName ¶
func (p *InitialIOSEncryptedGrade) TableName() string
TableName sets the insert table name for this struct type
type InitialIOSScheduledUpdateLog ¶
type InitialIOSScheduledUpdateLog struct {
ID int64 `gorm:"primary_key;auto_increment;not_null" json:"id"`
DeviceID string `gorm:"index:idx_scheduled_update_log_device,unique" json:"deviceId"`
Device InitialIOSDevice `gorm:"constraint:OnDelete:CASCADE;" json:"device"`
Type string `gorm:"type:enum ('grades');" json:"type"`
CreatedAt time.Time `gorm:"index:idx_scheduled_update_log_created,unique;autoCreateTime" json:"createdAt"`
}
InitialIOSScheduledUpdateLog logs the last time a device was updated.
func (*InitialIOSScheduledUpdateLog) TableName ¶
func (p *InitialIOSScheduledUpdateLog) TableName() string
TableName sets the insert table name for this struct type
type InitialIOSSchedulingPriority ¶
type InitialIOSSchedulingPriority struct {
ID int64 `gorm:"primary_key;auto_increment;not_null" json:"id"`
FromDay int `gorm:"not null" json:"from_day"`
ToDay int `gorm:"not null" json:"to_day"`
FromHour int `gorm:"not null" json:"from_hour"`
ToHour int `gorm:"not null" json:"to_hour"`
Priority int `gorm:"not null" json:"priority"`
}
func (*InitialIOSSchedulingPriority) TableName ¶
func (p *InitialIOSSchedulingPriority) TableName() string
TableName sets the insert table name for this struct type
type InitialStudentClub ¶
type InitialStudentClub struct {
gorm.Model
Name string
Description null.String
LinkUrl null.String `gorm:"type:varchar(190);unique;"`
ImageID null.Int
Image *File `gorm:"foreignKey:ImageID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
ImageCaption null.String
StudentClubCollectionID string `gorm:"type:varchar(100)"`
StudentClubCollection InitialStudentClubCollection `gorm:"foreignKey:StudentClubCollectionID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}
func (*InitialStudentClub) TableName ¶
func (n *InitialStudentClub) TableName() string
TableName sets the insert table name for this struct type
type InitialStudentClubCollection ¶
type InitialStudentClubCollection struct {
ID string `gorm:"primaryKey;type:varchar(100)"`
Description string
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
func (*InitialStudentClubCollection) TableName ¶
func (n *InitialStudentClubCollection) TableName() string
TableName sets the insert table name for this struct type
type KinoWithNullableFields ¶
type KinoWithNullableFields struct {
Year null.String `gorm:"column:year;type:varchar(4)"`
Runtime null.String `gorm:"column:runtime;type:varchar(40)"`
Genre null.String `gorm:"column:genre;type:varchar(100)"`
Director null.String `gorm:"column:director;type:text"`
Actors null.String `gorm:"column:actors;type:text"`
ImdbRating null.String `gorm:"column:rating;type:varchar(4)"`
Location null.String `gorm:"column:location;default:null"`
}
func (*KinoWithNullableFields) TableName ¶
func (n *KinoWithNullableFields) TableName() string
TableName sets the insert table name for this struct type
type KinoWithoutNullableFields ¶
type KinoWithoutNullableFields struct {
Year string `gorm:"column:year;type:varchar(4);not null;"`
Runtime string `gorm:"column:runtime;type:varchar(40);not null;"`
Genre string `gorm:"column:genre;type:varchar(100);not null;"`
Director string `gorm:"column:director;type:text;not null;"`
Actors string `gorm:"column:actors;type:text;not null;"`
ImdbRating string `gorm:"column:rating;type:varchar(4);not null;"`
}
type NewsSource ¶
type NewsSource struct {
Source int64 `gorm:"primary_key;autoIncrement;column:source;type:int;"`
Title string `gorm:"column:title;type:text;size:16777215;"`
URL null.String `gorm:"column:url;type:text;size:16777215;"`
FileID int64 `gorm:"column:icon;not null;type:int;"`
File NewsSourceFile `gorm:"foreignKey:FileID;references:file;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
Hook null.String `gorm:"column:hook;type:char;size:12;"`
}
NewsSource struct is a row record of the newsSource table in the tca database
func (*NewsSource) TableName ¶
func (n *NewsSource) TableName() string
TableName sets the insert table name for this struct type
type NewsSourceFile ¶
type NewsSourceFile struct {
File int64 `gorm:"primary_key;autoIncrement;column:file;type:int;"`
}
func (*NewsSourceFile) TableName ¶
func (n *NewsSourceFile) TableName() string
type PublishedExamResult ¶
type RoomfinderBuilding2area ¶
type RoomfinderBuilding2area struct {
BuildingNr string `gorm:"primary_key;column:building_nr;type:varchar(8);" json:"building_nr"`
AreaID int32 `gorm:"column:area_id;type:int;" json:"area_id"`
Campus string `gorm:"column:campus;type:char;size:1;" json:"campus"`
Name string `gorm:"column:name;type:varchar(32);" json:"name"`
}
RoomfinderBuilding2area struct is a row record of the roomfinder_building2area table in the tca database
func (*RoomfinderBuilding2area) TableName ¶
func (r *RoomfinderBuilding2area) TableName() string
TableName sets the insert table name for this struct type
type RoomfinderBuildings ¶
type RoomfinderBuildings struct {
BuildingNr string `gorm:"primary_key;column:building_nr;type:varchar(8);" json:"building_nr"`
UtmZone null.String `gorm:"column:utm_zone;type:varchar(4);" json:"utm_zone"`
UtmEasting null.String `gorm:"column:utm_easting;type:varchar(32);" json:"utm_easting"`
UtmNorthing null.String `gorm:"column:utm_northing;type:varchar(32);" json:"utm_northing"`
DefaultMapID null.Int `gorm:"column:default_map_id;type:int;" json:"default_map_id"`
}
RoomfinderBuildings struct is a row record of the roomfinder_buildings table in the tca database
func (*RoomfinderBuildings) TableName ¶
func (r *RoomfinderBuildings) TableName() string
TableName sets the insert table name for this struct type
type RoomfinderBuildings2gps ¶
type RoomfinderBuildings2gps struct {
ID string `gorm:"primary_key;column:id;type:varchar(8);" json:"id"`
Latitude null.String `gorm:"column:latitude;type:varchar(30);" json:"latitude"`
Longitude null.String `gorm:"column:longitude;type:varchar(30);" json:"longitude"`
}
RoomfinderBuildings2gps struct is a row record of the roomfinder_buildings2gps table in the tca database
func (*RoomfinderBuildings2gps) TableName ¶
func (r *RoomfinderBuildings2gps) TableName() string
TableName sets the insert table name for this struct type
type RoomfinderBuildings2maps ¶
type RoomfinderBuildings2maps struct {
BuildingNr string `gorm:"primary_key;column:building_nr;type:varchar(8);" json:"building_nr"`
MapID int64 `gorm:"primary_key;column:map_id;type:int;" json:"map_id"`
}
RoomfinderBuildings2maps struct is a row record of the roomfinder_buildings2maps table in the tca database
func (*RoomfinderBuildings2maps) TableName ¶
func (r *RoomfinderBuildings2maps) TableName() string
TableName sets the insert table name for this struct type
type RoomfinderRooms ¶
type RoomfinderRooms struct {
RoomID int64 `gorm:"primary_key;column:room_id;type:int;" json:"room_id"`
RoomCode null.String `gorm:"column:room_code;type:varchar(32);" json:"room_code"`
BuildingNr null.String `gorm:"column:building_nr;type:varchar(8);" json:"building_nr"`
ArchID null.String `gorm:"column:arch_id;type:varchar(16);" json:"arch_id"`
Info null.String `gorm:"column:info;type:varchar(64);" json:"info"`
Address null.String `gorm:"column:address;type:varchar(128);" json:"address"`
PurposeID null.Int `gorm:"column:purpose_id;type:int;" json:"purpose_id"`
Purpose null.String `gorm:"column:purpose;type:varchar(64);" json:"purpose"`
Seats null.Int `gorm:"column:seats;type:int;" json:"seats"`
UtmZone null.String `gorm:"column:utm_zone;type:varchar(4);" json:"utm_zone"`
UtmEasting null.String `gorm:"column:utm_easting;type:varchar(32);" json:"utm_easting"`
UtmNorthing null.String `gorm:"column:utm_northing;type:varchar(32);" json:"utm_northing"`
UnitID null.Int `gorm:"column:unit_id;type:int;" json:"unit_id"`
DefaultMapID null.Int `gorm:"column:default_map_id;type:int;" json:"default_map_id"`
}
RoomfinderRooms struct is a row record of the roomfinder_rooms table in the tca database
func (*RoomfinderRooms) TableName ¶
func (r *RoomfinderRooms) TableName() string
TableName sets the insert table name for this struct type
type RoomfinderRooms2maps ¶
type RoomfinderRooms2maps struct {
RoomID int64 `gorm:"primary_key;column:room_id;type:int;" json:"room_id"`
MapID int64 `gorm:"primary_key;column:map_id;type:int;" json:"map_id"`
}
RoomfinderRooms2maps struct is a row record of the roomfinder_rooms2maps table in the tca database
func (*RoomfinderRooms2maps) TableName ¶
func (r *RoomfinderRooms2maps) TableName() string
TableName sets the insert table name for this struct type
type ToFillCafeteriaRatingTagOption ¶
type ToFillCafeteriaRatingTagOption struct {
CafeteriaRatingsTagOption int64 `gorm:"primary_key;autoIncrement;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"`
}
func (*ToFillCafeteriaRatingTagOption) TableName ¶
func (n *ToFillCafeteriaRatingTagOption) TableName() string
TableName sets the insert table name for this struct type
type ToFillDishNameTagOption ¶
type ToFillDishNameTagOption struct {
DishNameTagOption int64 `gorm:"primary_key;autoIncrement;column:dishNameTagOption;type:int;not null;" json:"dishNameTagOption"`
DE string `gorm:"column:DE;type:text;not null;" json:"DE"`
EN string `gorm:"column:EN;type:text;not null;" json:"EN"`
}
func (*ToFillDishNameTagOption) TableName ¶
func (n *ToFillDishNameTagOption) TableName() string
TableName sets the insert table name for this struct type
type ToFillDishNameTagOptionExcluded ¶
type ToFillDishNameTagOptionExcluded struct {
DishNameTagOptionExcluded int64 `gorm:"primary_key;autoIncrement;column:dishNameTagOptionExcluded;type:int;not null;" json:"dishNameTagOptionExcluded"`
NameTagID int64 `gorm:"foreignKey:dishNameTagOption;column:nameTagID;type:int;not null;" json:"nameTagID"`
Expression string `gorm:"column:expression;type:text;" json:"expression"`
}
func (*ToFillDishNameTagOptionExcluded) TableName ¶
func (n *ToFillDishNameTagOptionExcluded) TableName() string
TableName sets the insert table name for this struct type
type ToFillDishNameTagOptionIncluded ¶
type ToFillDishNameTagOptionIncluded struct {
DishNameTagOptionIncluded int64 `gorm:"primary_key;autoIncrement;column:dishNameTagOptionIncluded;type:int;not null;" json:"dishNameTagOptionIncluded"`
NameTagID int64 `gorm:"foreignKey:dishNameTagOption;column:nameTagID;type:int;not null;" json:"nameTagID"`
Expression string `gorm:"column:expression;type:text;" json:"expression"`
}
func (*ToFillDishNameTagOptionIncluded) TableName ¶
func (n *ToFillDishNameTagOptionIncluded) TableName() string
TableName sets the insert table name for this struct type
type ToFillDishRatingTagOption ¶
type ToFillDishRatingTagOption struct {
DishRatingTagOption int64 `gorm:"primary_key;autoIncrement;column:dishRatingTagOption;type:int;not null;" json:"dishRatingTagOption"`
DE string `gorm:"column:DE;type:text;default:('de');not null;" json:"DE"`
EN string `gorm:"column:EN;type:text;default:('en');not null;" json:"EN"`
}
func (*ToFillDishRatingTagOption) TableName ¶
func (n *ToFillDishRatingTagOption) TableName() string
TableName sets the insert table name for this struct type
Source Files
¶
- 20200000000000.go
- 20210709193000.go
- 20220126230000.go
- 20220713000000.go
- 20221119131300.go
- 20221210000000.go
- 20230530000000.go
- 20230825000000.go
- 20230826000000.go
- 20230904000000.go
- 20230904100000.go
- 20231003000000.go
- 20231015000000.go
- 20231023000000.go
- 20240101000000.go
- 20240102000000.go
- 20240103000000.go
- 20240207000000.go
- 20240311000000.go
- 20240312000000.go
- 20240316000000.go
- 20240317000000.go
- 20240318000000.go
- 20240319000000.go
- 20240320000000.go
- 20240327000000.go
- 20240402000000.go
- 20240405000000.go
- 20240510000000.go
- 20240511000000.go
- 20240512000000.go
- 20240706000000.go
- 20240824000000.go
- 20241023000000.go
- 20250412000000.go
- 20261105000000.go
- 20261105010000.go
- 20261105020000.go
- migration.go
- rating_statistic_views.go
- safe_enum_migrate.go
- sql_migrations.go