diff options
| author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-30 17:03:32 +0200 |
|---|---|---|
| committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-30 17:03:32 +0200 |
| commit | ee5c67c092acc57a6ef2b8f7934ba827df43add6 (patch) | |
| tree | 83d8ac11ed7335ac9d992b06bd26e2906aa2a671 /planetwars-server | |
| parent | 1d280c62e23cf1f52398c4fe11474fdde4aaa74c (diff) | |
| download | planetwars.dev-ee5c67c092acc57a6ef2b8f7934ba827df43add6.tar.xz planetwars.dev-ee5c67c092acc57a6ef2b8f7934ba827df43add6.zip | |
add is_public to matches
Diffstat (limited to 'planetwars-server')
| -rw-r--r-- | planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/down.sql | 1 | ||||
| -rw-r--r-- | planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/up.sql | 1 | ||||
| -rw-r--r-- | planetwars-server/src/db/matches.rs | 2 | ||||
| -rw-r--r-- | planetwars-server/src/modules/client_api.rs | 1 | ||||
| -rw-r--r-- | planetwars-server/src/modules/matches.rs | 10 | ||||
| -rw-r--r-- | planetwars-server/src/modules/ranking.rs | 2 | ||||
| -rw-r--r-- | planetwars-server/src/routes/demo.rs | 1 | ||||
| -rw-r--r-- | planetwars-server/src/schema.rs | 1 |
8 files changed, 17 insertions, 2 deletions
diff --git a/planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/down.sql b/planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/down.sql new file mode 100644 index 0000000..7a0c0bf --- /dev/null +++ b/planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/down.sql @@ -0,0 +1 @@ +ALTER TABLE matches DROP COLUMN is_public; diff --git a/planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/up.sql b/planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/up.sql new file mode 100644 index 0000000..714de8c --- /dev/null +++ b/planetwars-server/migrations/2022-07-30-145155_add_public_to_matches/up.sql @@ -0,0 +1 @@ +ALTER TABLE matches ADD COLUMN is_public boolean NOT NULL DEFAULT false; diff --git a/planetwars-server/src/db/matches.rs b/planetwars-server/src/db/matches.rs index 061e2ea..be2a8be 100644 --- a/planetwars-server/src/db/matches.rs +++ b/planetwars-server/src/db/matches.rs @@ -15,6 +15,7 @@ use super::bots::{Bot, BotVersion}; pub struct NewMatch<'a> { pub state: MatchState, pub log_path: &'a str, + pub is_public: bool, } #[derive(Insertable)] @@ -36,6 +37,7 @@ pub struct MatchBase { pub log_path: String, pub created_at: NaiveDateTime, pub winner: Option<i32>, + pub is_public: bool, } #[derive(Queryable, Identifiable, Associations, Clone)] diff --git a/planetwars-server/src/modules/client_api.rs b/planetwars-server/src/modules/client_api.rs index 7026671..f960e1b 100644 --- a/planetwars-server/src/modules/client_api.rs +++ b/planetwars-server/src/modules/client_api.rs @@ -119,6 +119,7 @@ impl pb::client_api_service_server::ClientApiService for ClientApiServer { }); let run_match = RunMatch::from_players( self.runner_config.clone(), + false, vec