You are here

function oa_core_update_7228 in Open Atrium Core 7.2

Change the oa_unpublished gids from nid to uid.

Since the access change is rather simple, we're just scripting it for so big sites do not have a super long update.

File

./oa_core.install, line 299
Provides update and install hooks to oa_core.

Code

function oa_core_update_7228() {
  db_query('DELETE from {node_access} WHERE realm = :realm', array(
    ':realm' => OA_UNPUBLISHED_REALM,
  ));
  db_query('INSERT into {node_access} SELECT nid, uid, :realm, 1, 0, 0 from {node} WHERE status = 0 AND uid > 1', array(
    ':realm' => OA_UNPUBLISHED_REALM,
  ));
}