Skip to content

Commit

Permalink
CORE-1890: increase CPU hour quotas by a factor of 10
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Roberts authored and slr71 committed Mar 27, 2023
1 parent 55878ca commit aee09cf
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions migrations/000011_cpu_hours_increase.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--
-- Decreases the number of CPU hours available to users by a factor of 10.
--

BEGIN;

SET search_path = public, pg_catalog;

-- Divide the number of CPU hours for each subscription plan by 10.
UPDATE plan_quota_defaults
SET quota_value = CAST(quota_value / 10 AS bigint)
WHERE resource_type_id = (
SELECT id FROM resource_types
WHERE name = 'cpu.hours'
);

-- Divide the number of CPU hours for each subscription by 10.
UPDATE quotas
SET quota = CAST(quota / 10 AS bigint)
WHERE resource_type_id = (
SELECT id FROM resource_types
WHERE name = 'cpu.hours'
);

COMMIT;
25 changes: 25 additions & 0 deletions migrations/000011_cpu_hours_increase.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--
-- Increases the number of CPU hours available to users by a factor of 10.
--

BEGIN;

SET search_path = public, pg_catalog;

-- Multiply the number of CPU hours for each subscription plan by 10.
UPDATE plan_quota_defaults
SET quota_value = quota_value * 10
WHERE resource_type_id = (
SELECT id FROM resource_types
WHERE name = 'cpu.hours'
);

-- Multiply the number of CPU hours for each subscription by 10.
UPDATE quotas
SET quota = quota * 10
WHERE resource_type_id = (
SELECT id FROM resource_types
WHERE name = 'cpu.hours'
);

COMMIT;

0 comments on commit aee09cf

Please sign in to comment.