You are here

function hosting_platform_update_7401 in Hosting 7.4

Migrate data from hosting_git for each platform.

File

platform/hosting_platform.install, line 299
Define database schema and update functions for the Platforms module.

Code

function hosting_platform_update_7401() {
  $platforms = db_query('SELECT * FROM {hosting_git} g INNER JOIN {hosting_platform} p ON p.nid = g.nid');
  foreach ($platforms as $platform) {
    db_merge('hosting_platform')
      ->key(array(
      'nid' => $platform->nid,
    ))
      ->fields(array(
      'git_remote' => $platform->repo_url,
      'git_reference' => $platform->git_ref,
      'git_root' => $platform->repo_path,
      'git_docroot' => $platform->repo_docroot,
    ))
      ->execute();
  }
}