Files
creator-hub/internal/creator/migrations/019_metric_plans.sql
T

15 lines
617 B
SQL

CREATE TABLE IF NOT EXISTS creator_metric_plan (
work_id text PRIMARY KEY REFERENCES creator_work (id) ON DELETE CASCADE,
published_at timestamptz NOT NULL,
monitoring_end timestamptz NOT NULL,
next_plan_at timestamptz,
interval_seconds bigint NOT NULL,
multiplier double precision NOT NULL,
max_interval_seconds bigint NOT NULL,
point_index integer NOT NULL DEFAULT 0 CHECK (point_index >= 0),
stopped boolean NOT NULL DEFAULT false,
stop_reason text NOT NULL DEFAULT '',
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);