Skip to content
Permalink
Browse files

Merge pull request #49 from pathwar/dev/moul/model-fields

feat: refactor models + add fields
  • Loading branch information...
moul committed Mar 16, 2019
2 parents d1d015f + 1168216 commit cc451297dce2d506ca2336aa9833726c7aabea06
Showing with 7,544 additions and 2,276 deletions.
  1. +1 −1 docker-compose.yml
  2. +43 −23 entity/entity.go
  3. +7,151 −2,136 entity/entity.pb.go
  4. +306 −64 entity/entity.proto
  5. +1 −0 go.mod
  6. +1 −0 go.sum
  7. +2 −5 server/svc.go
  8. +1 −1 sql/cmd_sql.go
  9. +26 −25 sql/cmd_sql_adduser.go
  10. +12 −21 sql/sql.go
@@ -8,7 +8,7 @@ services:
- "/bin/bash"
- "-c"
command:
- "./wait-for-it.sh mysql:3306 -- /bin/pathwar.pw server --sql-config='root:uns3cur3@tcp(mysql:3306)/pathwar?charset=utf8'"
- "./wait-for-it.sh mysql:3306 -- /bin/pathwar.pw server --sql-config='root:uns3cur3@tcp(mysql:3306)/pathwar?charset=utf8&parseTime=true'"
depends_on:
- mysql
ports:
@@ -7,43 +7,63 @@ func ByName(name string) interface{} {
func AllMap() map[string]interface{} {
return map[string]interface{}{
"Achievement": Achievement{},
"AuthMethod": AuthMethod{},
"Coupon": Coupon{},
"CouponValidation": CouponValidation{},
"Event": Event{},
"Hypervisor": Hypervisor{},
"InventoryItem": InventoryItem{},
"Level": Level{},
"LevelFlavor": LevelFlavor{},
"LevelInstance": LevelInstance{},
"LevelSubscription": LevelSubscription{},
"Level": Level{},
"LevelValidation": LevelValidation{},
"LevelVersion": LevelVersion{},
"Notification": Notification{},
"ShopItem": ShopItem{},
"TeamMember": TeamMember{},
"Team": Team{},
"TournamentTeam": TournamentTeam{},
"TeamMember": TeamMember{},
"Tournament": Tournament{},
"UserSession": UserSession{},
"TournamentMember": TournamentMember{},
"TournamentTeam": TournamentTeam{},
"User": User{},
"UserSession": UserSession{},
"WhoswhoAttempt": WhoswhoAttempt{},
}
}

func All() []interface{} {
return []interface{}{
Achievement{},
Coupon{},
Event{},
Hypervisor{},
LevelFlavor{},
LevelInstance{},
LevelSubscription{},
Level{},
Notification{},
ShopItem{},
TeamMember{},
Team{},
TournamentTeam{},
Tournament{},
UserSession{},
User{},
WhoswhoAttempt{},
out := []interface{}{}
for _, entry := range AllMap() {
out = append(out, entry)
}
return out
}

func ForeignKeys() [][3]string {
return [][3]string{
{"Achievement", "author_id", "tournament_member(id)"},
{"Achievement", "level_validation_id", "level_validation(id)"},
{"Coupon", "tournament_id", "tournament(id)"},
{"CouponValidation", "author_id", "tournament_member(id)"},
{"CouponValidation", "coupon_id", "coupon(id)"},
{"InventoryItem", "owner_id", "tournament_member(id)"},
{"LevelFlavor", "level_id", "level(id)"},
{"LevelInstance", "flavor_id", "level_flavor(id)"},
{"LevelInstance", "hypervisor_id", "hypervisor(id)"},
{"LevelSubscription", "level_flavor_id", "level_flavor(id)"},
{"LevelSubscription", "tournament_team_id", "tournament_team(id)"},
{"LevelValidation", "level_subscription_id", "level_subscription(id)"},
{"LevelVersion", "level_id", "level(id)"},
{"Notification", "user_id", "user(id)"},
{"TeamMember", "team_id", "team(id)"},
{"TeamMember", "user_id", "user(id)"},
{"TournamentMember", "tournament_team_id", "tournament_team(id)"},
{"TournamentMember", "user_id", "user(id)"},
{"TournamentTeam", "team_id", "team(id)"},
{"TournamentTeam", "tournament_id", "tournament(id)"},
{"UserSession", "user_id", "user(id)"},
{"WhoswhoAttempt", "author_id", "tournament_member(id)"},
{"WhoswhoAttempt", "target_member_id", "tournament_member(id)"},
{"WhoswhoAttempt", "target_team_id", "tournament_team(id)"},
}
}
Oops, something went wrong.

0 comments on commit cc45129

Please sign in to comment.
You can’t perform that action at this time.