[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/install/resources/ -> upgrade20.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.6
   4   * Copyright 2010 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybboard.com
   7   * License: http://mybb.com/about/license
   8   *
   9   * $Id$
  10   */
  11  
  12  /**
  13   * Upgrade Script: 1.6.3
  14   */
  15  
  16  $upgrade_detail = array(
  17      "revert_all_templates" => 0,
  18      "revert_all_themes" => 0,
  19      "revert_all_settings" => 0
  20  );
  21  
  22  @set_time_limit(0);
  23  
  24  function upgrade20_dbchanges()
  25  {
  26      global $db, $output, $mybb;
  27  
  28      $output->print_header("Repairing Database Sequences");
  29  
  30      echo "<p>Performing necessary upgrade queries...</p>";
  31  
  32      // Update the sequences for pgSQL - #1094, #1248
  33      if($mybb->config['database']['type'] == "pgsql")
  34      {
  35          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}attachtypes_atid_seq', (SELECT max(atid) FROM {$mybb->config['database']['table_prefix']}attachtypes));");
  36          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}forums_fid_seq', (SELECT max(fid) FROM {$mybb->config['database']['table_prefix']}forums));");
  37          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}helpdocs_hid_seq', (SELECT max(hid) FROM {$mybb->config['database']['table_prefix']}helpdocs));");
  38          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}helpsections_sid_seq', (SELECT max(sid) FROM {$mybb->config['database']['table_prefix']}helpsections));");
  39          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}icons_iid_seq', (SELECT max(iid) FROM {$mybb->config['database']['table_prefix']}icons));");
  40          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}profilefields_fid_seq', (SELECT max(fid) FROM {$mybb->config['database']['table_prefix']}profilefields));");
  41          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}smilies_sid_seq', (SELECT max(sid) FROM {$mybb->config['database']['table_prefix']}smilies));");
  42          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}spiders_sid_seq', (SELECT max(sid) FROM {$mybb->config['database']['table_prefix']}spiders));");
  43          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}templategroups_gid_seq', (SELECT max(gid) FROM {$mybb->config['database']['table_prefix']}templategroups));");
  44          $db->query("SELECT setval('{$mybb->config['database']['table_prefix']}usergroups_gid_seq', (SELECT max(gid) FROM {$mybb->config['database']['table_prefix']}usergroups));");
  45      }
  46  
  47      $db->add_column("adminviews", "custom_profile_fields", "text NOT NULL AFTER conditions");
  48  
  49      $output->print_contents("<p>Click next to continue with the upgrade process.</p>");
  50      $output->print_footer("20_done");
  51  }
  52  ?>


Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1