migration

package
v0.0.0-...-a3f729a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package migration contains functions related to database changes and executes them

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEnum

func BuildEnum(types []string) string

func EnumTypesFromString

func EnumTypesFromString(enum string) ([]string, error)

func Migrate

func Migrate(db *gorm.DB, shouldAutoMigrate bool) error

Migrate starts the migration either by using AutoMigrate in development environments or manually in prod

func RemoveTypes

func RemoveTypes(types []string, rollbackTypes ...string) []string

func SafeEnumAdd

func SafeEnumAdd(tx *gorm.DB, table interface{}, column string, additionalTypes ...string) error

func SafeEnumRemove

func SafeEnumRemove(tx *gorm.DB, table interface{}, column string, rollbackTypes ...string) error

Types

type CafeteriaRatingAverage

type CafeteriaRatingAverage struct {
	CafeteriaRatingAverage int64   `gorm:"primary_key;AUTO_INCREMENT;column:cafeteriaRatingAverage;type:int;not null;"`
	CafeteriaID            int64   `gorm:"column:cafeteriaID;foreignKey:cafeteria;type:int;not null;"`
	Average                float64 `gorm:"column:average;type:float;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:float;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 CafeteriaRatingTagOption

type CafeteriaRatingTagOption struct {
	CafeteriaRatingsTagOption int64  `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"`
}

State of the models at this migration

type CafeteriaRatingTagsAverage

type CafeteriaRatingTagsAverage struct {
	CafeteriaRatingTagsAverage int64   `gorm:"primary_key;AUTO_INCREMENT;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                    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"`
}

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;AUTO_INCREMENT;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            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"`
}

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 DishNameTagOption

type DishNameTagOption struct {
	DishNameTagOption int64  `gorm:"primary_key;AUTO_INCREMENT;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 (*DishNameTagOption) TableName

func (n *DishNameTagOption) TableName() string

TableName sets the insert table name for this struct type

type DishNameTagOptionExcluded

type DishNameTagOptionExcluded struct {
	DishNameTagOptionExcluded int64  `gorm:"primary_key;AUTO_INCREMENT;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 (*DishNameTagOptionExcluded) TableName

func (n *DishNameTagOptionExcluded) TableName() string

TableName sets the insert table name for this struct type

type DishNameTagOptionIncluded

type DishNameTagOptionIncluded struct {
	DishNameTagOptionIncluded int64  `gorm:"primary_key;AUTO_INCREMENT;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 (*DishNameTagOptionIncluded) TableName

func (n *DishNameTagOptionIncluded) TableName() string

TableName sets the insert table name for this struct type

type DishRatingAverage

type DishRatingAverage struct {
	DishRatingAverage int64   `gorm:"primary_key;AUTO_INCREMENT;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:float;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:float;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;AUTO_INCREMENT;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               float32 `gorm:"column:average;type:float;not null;"`
	Min                   int8    `gorm:"column:min;type:int;not null;"`
	Max                   int8    `gorm:"column:max;type:int;not null;"`
	Std                   float32 `gorm:"column:std;type:float;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 DishRatingTagOption

type DishRatingTagOption struct {
	DishRatingTagOption int64  `gorm:"primary_key;AUTO_INCREMENT;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"`
}

type Feedback

type Feedback struct {
	Processed  bool        `gorm:"column:processed;type:boolean;default:false;not null;"`
	OsVersion  null.String `gorm:"column:os_version;type:text;null;"`
	AppVersion null.String `gorm:"column:app_version;type:text;null;"`
}

func (*Feedback) TableName

func (n *Feedback) TableName() string

TableName sets the insert table name for this struct type

type File

type File struct {
	File       int64       `gorm:"primary_key;AUTO_INCREMENT;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;" 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 IOSDevicesActivityReset struct {
	Type      string    `gorm:"primary_key;type:enum('day', 'week', 'month', 'year')"`
	LastReset time.Time `gorm:"autoCreateTime"`
}

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;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" `
	Longitude float32 `gorm:"column:longitude;type:float;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;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     int64     `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"`
}

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;AUTO_INCREMENT;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:float;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:float;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;AUTO_INCREMENT;column:CafeteriaRatingTag;type:int;not null;" json:"CanteenRatingTag" `
	CorrespondingRating int64 `gorm:"foreignKey:cafeteriaRatingID;column:correspondingRating;type:int;not null;" json:"correspondingRating"`
	Points              int32 `gorm:"column:points;type:int;not null;" json:"points"`
	TagID               int64 `gorm:"foreignKey:cafeteriaRatingTagOption;column:tagID;type:int;not null;" json:"tagID"`
}

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;AUTO_INCREMENT;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                    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"`
}

InitialCafeteriaRatingTagAverage stores all precomputed values for the cafeteria ratings

func (*InitialCafeteriaRatingTagAverage) TableName

TableName sets the insert table name for this struct type

type InitialCafeteriaRatingTagOption

type InitialCafeteriaRatingTagOption struct {
	CafeteriaRatingsTagOption int64  `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"`
}

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;" 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;AUTO_INCREMENT;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;AUTO_INCREMENT;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;AUTO_INCREMENT;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            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"`
}

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;AUTO_INCREMENT;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;AUTO_INCREMENT;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

TableName sets the insert table name for this struct type

type InitialDishNameTagOptionIncluded

type InitialDishNameTagOptionIncluded struct {
	DishNameTagOptionIncluded int64  `gorm:"primary_key;AUTO_INCREMENT;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

TableName sets the insert table name for this struct type

type InitialDishRating

type InitialDishRating struct {
	DishRating  int64     `gorm:"primary_key;AUTO_INCREMENT;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;" 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;AUTO_INCREMENT;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:float;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:float;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;AUTO_INCREMENT;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;AUTO_INCREMENT;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               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"`
}

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;AUTO_INCREMENT;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;AUTO_INCREMENT;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;AUTO_INCREMENT;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:"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 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 NewExamResultsSubscriber

type NewExamResultsSubscriber struct {
	CallbackUrl    string `gorm:"primary_key"`
	ApiKey         null.String
	CreatedAt      time.Time `gorm:"autoCreateTime"`
	LastNotifiedAt null.Time
}

type NewsSource

type NewsSource struct {
	Source int64          `gorm:"primary_key;AUTO_INCREMENT;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;AUTO_INCREMENT;column:file;type:int;"`
}

func (*NewsSourceFile) TableName

func (n *NewsSourceFile) TableName() string

type PublishedExamResult

type PublishedExamResult struct {
	Date         time.Time
	ExamID       string `gorm:"primary_key"`
	LectureTitle string
	LectureType  string
	LectureSem   string
	Published    bool
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL