begin
insert into RDS_OLD_CLIP_LYRICS
select 
    id as clip_id,
    PARSE_JSON(metadata):prompt,
    prompt_text,
    created_at::timestamp as created_at,
    date(created_at::timestamp) as p_date,
    hour(created_at::timestamp) as p_hour
from clip
where p_date < '2024-01-01';

UPDATE clip
SET prompt_text = NULL,
    metadata = TO_JSON(OBJECT_DELETE(PARSE_JSON(metadata), 'prompt'))
WHERE p_date < '2024-01-01';
end;