-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORE-1890: increase CPU hour quotas by a factor of 10
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |