select
cr.title,
cr. description,
pa.story,
ci.live_revision as previous_revision
from cr_items ci,
cr_revisions cr,
pa_albums pa
where ci.live_revision = cr.revision_id
and cr.revision_id = pa.pa_album_id
and ci.item_id = :album_id
insert into pa_albums (pa_album_id, story)
values
(:revision_id, :new_story)