-- +goose Up
CREATE UNIQUE INDEX ux_tasks_external_ref
ON tasks (external_provider, external_id)
WHERE external_provider IS NOT NULL AND external_id IS NOT NULL;

-- +goose Down
DROP INDEX IF EXISTS ux_tasks_external_ref;
