aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/migrations/2022-08-23-174628_maps
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-23 20:00:21 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-23 20:00:21 +0200
commitaa066ef5bb9ed043feafd0e87e219cb34cce35c5 (patch)
tree9773cfd035a712e951ad9490e95c05f723aa22b1 /planetwars-server/migrations/2022-08-23-174628_maps
parentfa4c684475a365055c2aacdf712c7903c9a5f2f2 (diff)
downloadplanetwars.dev-aa066ef5bb9ed043feafd0e87e219cb34cce35c5.tar.xz
planetwars.dev-aa066ef5bb9ed043feafd0e87e219cb34cce35c5.zip
create maps table
Diffstat (limited to 'planetwars-server/migrations/2022-08-23-174628_maps')
-rw-r--r--planetwars-server/migrations/2022-08-23-174628_maps/down.sql3
-rw-r--r--planetwars-server/migrations/2022-08-23-174628_maps/up.sql7
2 files changed, 10 insertions, 0 deletions
diff --git a/planetwars-server/migrations/2022-08-23-174628_maps/down.sql b/planetwars-server/migrations/2022-08-23-174628_maps/down.sql
new file mode 100644
index 0000000..7489122
--- /dev/null
+++ b/planetwars-server/migrations/2022-08-23-174628_maps/down.sql
@@ -0,0 +1,3 @@
+ALTER TABLE matches DROP COLUMN map_id;
+
+DROP TABLE maps; \ No newline at end of file
diff --git a/planetwars-server/migrations/2022-08-23-174628_maps/up.sql b/planetwars-server/migrations/2022-08-23-174628_maps/up.sql
new file mode 100644
index 0000000..c66fc9f
--- /dev/null
+++ b/planetwars-server/migrations/2022-08-23-174628_maps/up.sql
@@ -0,0 +1,7 @@
+CREATE TABLE maps (
+ id SERIAL PRIMARY KEY,
+ name TEXT UNIQUE NOT NULL,
+ file_path TEXT NOT NULL
+);
+
+ALTER TABLE matches ADD COLUMN map_id INTEGER REFERENCES maps(id); \ No newline at end of file