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-05 20:33:39 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-05 20:33:39 +0200
commit8a47b948eb88f1e0ff649880a70f9416306bac92 (patch)
tree1a73ef0da783e2d65ab806338d9fcc939db7a0dc /planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version
parentea05674b4473d9399f5aa6dca982ae73aad0ebcf (diff)
downloadplanetwars.dev-8a47b948eb88f1e0ff649880a70f9416306bac92.tar.xz
planetwars.dev-8a47b948eb88f1e0ff649880a70f9416306bac92.zip
migrate code_bundles to bot_versions
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.sql4
2 files changed, 8 insertions, 0 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
new file mode 100644
index 0000000..bc2d7d6
--- /dev/null
+++ b/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/down.sql
@@ -0,0 +1,4 @@
+ALTER TABLE bot_versions DROP COLUMN container_digest;
+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
new file mode 100644
index 0000000..0b28df7
--- /dev/null
+++ b/planetwars-server/migrations/2022-07-04-200149_code_bundle_to_bot_version/up.sql
@@ -0,0 +1,4 @@
+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;