select related_object_id as correction_file_id
from cr_item_rels
where item_id = :file_id
and relation_tag = 'homework_correction'
select name, content_type from cr_items where item_id = :file_id
select item_id as new_homework_id
from cr_revisions
where revision_id = :new_homework_revision_id
select item_id as new_correction_id
from cr_revisions
where revision_id = :new_correction_revision_id
update acs_objects
set security_inherit_p = 'f'
where object_id = :new_homework_id
update acs_objects
set security_inherit_p = 'f'
where object_id = :new_correction_id
update acs_objects
set context_id = null
where object_id = :new_homework_id
update acs_objects
set context_id = null
where object_id = :new_correction_id