Перейти к содержанию

tasks

Колонки

колонка тип not null default
id "uuid" "gen_random_uuid"()
user_id "uuid" ``
tool "text" ``
model "text" ``
cost numeric(12,3) ``
status "text" 'created'::"text"
meta "jsonb" '{}'::"jsonb"
comet_task_id "text" ``
created_at timestamp with time zone "now"()
finished_at timestamp with time zone ``
updated_at timestamp with time zone "now"()

Ограничения

  • CONSTRAINT "tasks_finished_at_needed" CHECK ( CASE WHEN ("lower"(COALESCE("status", ''::"text")) = ANY (ARRAY['success'::"text", 'fail'::"text", 'refunded'::"text"])) THEN ("finished_at" IS NOT NULL) ELSE true END)
  • CONSTRAINT "tasks_pkey" PRIMARY KEY ("id")
  • CONSTRAINT "tasks_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE SET NULL

Внешние ключи

  • (user_id) → users(id)