Last active
July 31, 2019 13:48
-
-
Save kamal-kambe/9d423e2b2996bd6c148d6e4bb60268c9 to your computer and use it in GitHub Desktop.
Revisions
-
kamal-kambe renamed this gist
Jul 31, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
kamal-kambe revised this gist
Jul 31, 2019 . 1 changed file with 28 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ package model import ( "encoding/json" "time" ) type Building struct { ID uint `gorm:"primary_key" json:"id"` @@ -10,4 +13,28 @@ type Building struct { DisplayName string `json:"display_name"` Version uint `json:"version"` BuildingLevels []*BuildingLevel } type BuildingLevel struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"-"` DeletedAt *time.Time `sql:"index" json:"-"` BuildingID uint LevelNo uint Costs json.RawMessage `sql:"type:json"` Version uint } type Quest struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"-"` DeletedAt *time.Time `sql:"index" json:"-"` Name string `json:"name"` Category string `json:"category"` Description string `sql:"type:text"` DependentQuestID uint `json:"dependent_quest_id"` Task json.RawMessage `sql:"type:json"` RequiredQuantity uint `gorm:"default:1" json:"required_quantity"` Reward json.RawMessage `sql:"type:json"` Version uint `json:"version"` } -
kamal-kambe revised this gist
Jul 31, 2019 . 2 changed files with 13 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ package model import "time" type Building struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"-"` DeletedAt *time.Time `sql:"index" json:"-"` Name string `gorm:"UNIQUE; not null" json:"name"` DisplayName string `json:"display_name"` Version uint `json:"version"` BuildingLevels []*BuildingLevel } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +0,0 @@ -
kamal-kambe created this gist
Jul 31, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ package model import "time" type Player struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt *time.Time `sql:"index" json:"-"` Name string `json:"name"` DeviceID string `sql:"UNIQUE;not null;index:idx_player_device_id" json:"device_id"` Email string `sql:"UNIQUE;not null;index:idx_player_email" json:"email"` Platform string }