-- name: repository_merge_signal__insert :one
INSERT INTO provider_hub_repository_merge_signals (
    id,
    signal_key,
    kind,
    provider_slug,
    project_id,
    repository_id,
    repository_full_name,
    provider_repository_id,
    work_item_projection_id,
    provider_work_item_id,
    pull_request_number,
    pull_request_provider_id,
    pull_request_url,
    base_branch,
    head_branch,
    merge_commit_sha,
    source_ref,
    related_provider_operation_ref,
    watermark_digest,
    observed_at,
    merged_at,
    status,
    version,
    created_at,
    updated_at
) VALUES (
    @id,
    @signal_key,
    @kind,
    @provider_slug,
    @project_id,
    @repository_id,
    @repository_full_name,
    @provider_repository_id,
    @work_item_projection_id,
    @provider_work_item_id,
    @pull_request_number,
    @pull_request_provider_id,
    @pull_request_url,
    @base_branch,
    @head_branch,
    @merge_commit_sha,
    @source_ref,
    @related_provider_operation_ref,
    @watermark_digest,
    @observed_at,
    @merged_at,
    @status,
    @version,
    @created_at,
    @updated_at
)
ON CONFLICT (signal_key) DO NOTHING
RETURNING
    id,
    signal_key,
    kind,
    provider_slug,
    project_id,
    repository_id,
    repository_full_name,
    provider_repository_id,
    work_item_projection_id,
    provider_work_item_id,
    pull_request_number,
    pull_request_provider_id,
    pull_request_url,
    base_branch,
    head_branch,
    merge_commit_sha,
    source_ref,
    related_provider_operation_ref,
    watermark_digest,
    observed_at,
    merged_at,
    status,
    version,
    created_at,
    updated_at;
