Skip to content
Permalink
Browse files

feat: define schema relationships

  • Loading branch information...
moul committed Mar 14, 2019
1 parent 6ac6467 commit 54022dd74f3d83e4ce78d818019aedda4b7cabbd
Showing with 1,990 additions and 269 deletions.
  1. +1 −1 .circleci/config.yml
  2. +4 −2 docker-compose.yml
  3. +27 −1 entity/entity.go
  4. +1,888 −258 entity/entity.pb.go
  5. +46 −4 entity/entity.proto
  6. +23 −2 sql/sql.go
  7. +1 −1 test/docker-compose.yml
@@ -50,7 +50,7 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
- run: docker build -t pathwar/pathwar .
- run: docker build -t pathwar/test ./test
- run: docker build -t pathwar/pathwar:test ./test
- run: make integration.run
- run: make integration.run # yes, again
- run: docker-compose logs
@@ -4,9 +4,11 @@ services:
server:
image: pathwar/pathwar:latest
build: .
entrypoint: /bin/bash -c
entrypoint:
- "/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'"
depends_on:
- mysql
ports:
@@ -1,7 +1,34 @@
package entity

func ByName(name string) interface{} {
return AllMap()[name]
}

func AllMap() map[string]interface{} {
return map[string]interface{}{
"Achievement": Achievement{},
"Coupon": Coupon{},
"Event": Event{},
"Hypervisor": Hypervisor{},
"LevelFlavor": LevelFlavor{},
"LevelInstance": LevelInstance{},
"LevelSubscription": LevelSubscription{},
"Level": Level{},
"Notification": Notification{},
"ShopItem": ShopItem{},
"TeamMember": TeamMember{},
"Team": Team{},
"TournamentTeam": TournamentTeam{},
"Tournament": Tournament{},
"UserSession": UserSession{},
"User": User{},
"WhoswhoAttempt": WhoswhoAttempt{},
}
}

func All() []interface{} {
return []interface{}{
Achievement{},
Coupon{},
Event{},
Hypervisor{},
@@ -18,6 +45,5 @@ func All() []interface{} {
UserSession{},
User{},
WhoswhoAttempt{},
Achievement{},
}
}
Oops, something went wrong.

0 comments on commit 54022dd

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