-- name: ListRoadmapSyncSteps :many
SELECT id, roadmap_sync_identity_id, step, completed_at
FROM roadmap_sync_steps
WHERE roadmap_sync_identity_id = $1
ORDER BY id;

-- name: MarkRoadmapSyncStepCompleted :one
INSERT INTO roadmap_sync_steps (roadmap_sync_identity_id, step)
VALUES ($1, $2)
ON CONFLICT (roadmap_sync_identity_id, step)
DO UPDATE SET roadmap_sync_identity_id = EXCLUDED.roadmap_sync_identity_id
RETURNING id, roadmap_sync_identity_id, step, completed_at;
