From 60e8ba1889eb3ceeef6774d6fbab61ff5ba35275 Mon Sep 17 00:00:00 2001 From: Sarah Roberts Date: Thu, 20 Apr 2023 12:20:50 -0700 Subject: [PATCH] added a conversion for the data add-on --- migrations/000012_data_addon.down.sql | 11 +++++++++++ migrations/000012_data_addon.up.sql | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 migrations/000012_data_addon.down.sql create mode 100644 migrations/000012_data_addon.up.sql diff --git a/migrations/000012_data_addon.down.sql b/migrations/000012_data_addon.down.sql new file mode 100644 index 0000000..19fc276 --- /dev/null +++ b/migrations/000012_data_addon.down.sql @@ -0,0 +1,11 @@ +-- +-- Deletes the add-on for data-only subscriptions. +-- + +BEGIN; + +SET search_path = public, pg_catalog; + +DELETE FROM addons WHERE id = 'c21dd61f-aa41-40ad-8005-859679ceed9c'; + +COMMIT; diff --git a/migrations/000012_data_addon.up.sql b/migrations/000012_data_addon.up.sql new file mode 100644 index 0000000..6ceda54 --- /dev/null +++ b/migrations/000012_data_addon.up.sql @@ -0,0 +1,20 @@ +-- +-- Creates an add-on for data-only subscriptions. +-- + +BEGIN; + +SET search_path = public, pg_catalog; + +INSERT INTO addons (id, name, description, resource_type_id, default_amount, default_paid) +VALUES ( + 'c21dd61f-aa41-40ad-8005-859679ceed9c', + '1 TB', + '1 TB of data storage for one year.', + (SELECT id FROM resource_types WHERE name = 'data.size'), + power(2, 40), + TRUE +) +ON CONFLICT DO NOTHING; + +COMMIT;