Added sql to update old core flag to new core_status refdata