aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/migrations/2022-01-02-105610_matches
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-01-03 23:33:00 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-01-03 23:36:19 +0100
commit5b10d5e98e806ce867d27c4cc7b7f5651656744f (patch)
tree1397bc803f1b87e8811be05334a7aeb45032811b /planetwars-server/migrations/2022-01-02-105610_matches
parent1cde40b45916d1f99a4cda7837b516cde761f127 (diff)
downloadplanetwars.dev-5b10d5e98e806ce867d27c4cc7b7f5651656744f.tar.xz
planetwars.dev-5b10d5e98e806ce867d27c4cc7b7f5651656744f.zip
add match_state to matches
Diffstat (limited to 'planetwars-server/migrations/2022-01-02-105610_matches')
-rw-r--r--planetwars-server/migrations/2022-01-02-105610_matches/down.sql3
-rw-r--r--planetwars-server/migrations/2022-01-02-105610_matches/up.sql5
2 files changed, 6 insertions, 2 deletions
diff --git a/planetwars-server/migrations/2022-01-02-105610_matches/down.sql b/planetwars-server/migrations/2022-01-02-105610_matches/down.sql
index eadd0fa..430bb1b 100644
--- a/planetwars-server/migrations/2022-01-02-105610_matches/down.sql
+++ b/planetwars-server/migrations/2022-01-02-105610_matches/down.sql
@@ -1,3 +1,4 @@
DROP TABLE match_players;
DROP INDEX match_created_at;
-DROP TABLE matches; \ No newline at end of file
+DROP TABLE matches;
+DROP TYPE match_state; \ No newline at end of file
diff --git a/planetwars-server/migrations/2022-01-02-105610_matches/up.sql b/planetwars-server/migrations/2022-01-02-105610_matches/up.sql
index 88c8c9e..ace13fd 100644
--- a/planetwars-server/migrations/2022-01-02-105610_matches/up.sql
+++ b/planetwars-server/migrations/2022-01-02-105610_matches/up.sql
@@ -1,5 +1,8 @@
+CREATE TYPE match_state AS ENUM ('playing', 'ended');
+
CREATE TABLE matches (
- id SERIAL PRIMARY KEY,
+ id SERIAL PRIMARY KEY NOT NULL,
+ state match_state NOT NULL,
log_path text NOT NULL,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);