mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
13 lines
656 B
SQL
13 lines
656 B
SQL
CREATE UNIQUE INDEX IF NOT EXISTS "issues_active_liveness_recovery_incident_uq"
|
|
ON "issues" USING btree ("company_id","origin_kind","origin_id")
|
|
WHERE "origin_kind" = 'harness_liveness_escalation'
|
|
AND "origin_id" IS NOT NULL
|
|
AND "hidden_at" IS NULL
|
|
AND "status" NOT IN ('done', 'cancelled');
|
|
--> statement-breakpoint
|
|
CREATE UNIQUE INDEX IF NOT EXISTS "issues_active_liveness_recovery_leaf_uq"
|
|
ON "issues" USING btree ("company_id","origin_kind","origin_fingerprint")
|
|
WHERE "origin_kind" = 'harness_liveness_escalation'
|
|
AND "origin_fingerprint" <> 'default'
|
|
AND "hidden_at" IS NULL
|
|
AND "status" NOT IN ('done', 'cancelled');
|