The following code seems to work (notice the rel_segments_grant_permission as its also needed):
ad_proc -public unarchive {
{-community_id:required}
} {
Unarchives a community.
} {
#error
#ad_script_abort
db_dml update_archive_p {}
rel_segments_grant_permission -community_id $community_id
}