mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-05-07 02:19:46 -05:00
fix: migration (#1395)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
-- +goose Up
|
||||
-- +goose NO TRANSACTION
|
||||
ALTER TYPE "LimitResource" ADD VALUE 'TASK_RUN';
|
||||
ALTER TYPE "LimitResource" ADD VALUE IF NOT EXISTS 'TASK_RUN';
|
||||
|
||||
ALTER TYPE "LimitResource" ADD VALUE 'WORKER_SLOT';
|
||||
ALTER TYPE "LimitResource" ADD VALUE IF NOT EXISTS 'WORKER_SLOT';
|
||||
-- Insert WORKER_SLOT entries (limitValue = 1000x WORKER limit, customValueMeter = true)
|
||||
INSERT INTO "TenantResourceLimit" (
|
||||
"id",
|
||||
@@ -23,14 +23,15 @@ SELECT
|
||||
CURRENT_TIMESTAMP,
|
||||
'WORKER_SLOT',
|
||||
"tenantId",
|
||||
"limitValue" * 1000,
|
||||
"alarmValue" * 1000,
|
||||
least(("limitValue"::bigint) * 1000, 2147483647)::integer,
|
||||
least(("alarmValue"::bigint) * 1000, 2147483647)::integer,
|
||||
0,
|
||||
"window",
|
||||
"lastRefill",
|
||||
true
|
||||
FROM "TenantResourceLimit"
|
||||
WHERE "resource" = 'WORKER';
|
||||
WHERE "resource" = 'WORKER'
|
||||
ON CONFLICT ("tenantId", "resource") DO NOTHING;
|
||||
|
||||
-- Insert TASK_RUN entries (limitValue = 10x WORKFLOW_RUN limit, customValueMeter = false)
|
||||
INSERT INTO "TenantResourceLimit" (
|
||||
@@ -52,14 +53,15 @@ SELECT
|
||||
CURRENT_TIMESTAMP,
|
||||
'TASK_RUN',
|
||||
"tenantId",
|
||||
"limitValue" * 10,
|
||||
"alarmValue" * 10,
|
||||
least(("limitValue"::bigint) * 10, 2147483647)::integer,
|
||||
least(("alarmValue"::bigint) * 10, 2147483647)::integer,
|
||||
0,
|
||||
"window",
|
||||
"lastRefill",
|
||||
false
|
||||
FROM "TenantResourceLimit"
|
||||
WHERE "resource" = 'WORKFLOW_RUN';
|
||||
WHERE "resource" = 'WORKFLOW_RUN'
|
||||
ON CONFLICT ("tenantId", "resource") DO NOTHING;
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
|
||||
Reference in New Issue
Block a user