aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-06 22:41:27 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-06 22:41:27 +0200
commitd7b7585dd70f9d41184cf88c2ecbd88341898c38 (patch)
tree89a7fc180152f18273159104265e7894718e8560 /planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version
parentb3df5c6f8cc59e099a2f1db3df8089af4abca02e (diff)
downloadplanetwars.dev-d7b7585dd70f9d41184cf88c2ecbd88341898c38.tar.xz
planetwars.dev-d7b7585dd70f9d41184cf88c2ecbd88341898c38.zip
rename code_bundle to bot_version
Diffstat (limited to 'planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version')
-rw-r--r--planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/down.sql4
-rw-r--r--planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/up.sql2
2 files changed, 5 insertions, 1 deletions
diff --git a/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/down.sql b/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/down.sql
index bc2d7d6..89058fe 100644
--- a/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/down.sql
+++ b/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/down.sql
@@ -1,4 +1,6 @@
+ALTER TABLE match_players RENAME COLUMN bot_version_id TO code_bundle_id;
+
ALTER TABLE bot_versions DROP COLUMN container_digest;
-ALTER TABLE bot_versions RENAME COLUMN code_bundle_path to path;
+ALTER TABLE bot_versions RENAME COLUMN code_bundle_path TO path;
ALTER TABLE bot_versions ALTER COLUMN path SET NOT NULL;
ALTER TABLE bot_versions RENAME TO code_bundles;
diff --git a/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/up.sql b/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/up.sql
index 0b28df7..91afc0c 100644
--- a/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/up.sql
+++ b/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/up.sql
@@ -2,3 +2,5 @@ ALTER TABLE code_bundles RENAME TO bot_versions;
ALTER TABLE bot_versions RENAME COLUMN path to code_bundle_path;
ALTER TABLE bot_versions ALTER COLUMN code_bundle_path DROP NOT NULL;
ALTER TABLE bot_versions ADD COLUMN container_digest TEXT;
+
+ALTER TABLE match_players RENAME COLUMN code_bundle_id TO bot_version_id;