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;