[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/admin/ -> schema.php (source)

   1  <?php
   2  # MantisBT - A PHP based bugtracking system
   3  
   4  # MantisBT is free software: you can redistribute it and/or modify
   5  # it under the terms of the GNU General Public License as published by
   6  # the Free Software Foundation, either version 2 of the License, or
   7  # (at your option) any later version.
   8  #
   9  # MantisBT is distributed in the hope that it will be useful,
  10  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  # GNU General Public License for more details.
  13  #
  14  # You should have received a copy of the GNU General Public License
  15  # along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  # Each entry below defines the schema. The upgrade array consists of
  18  #  two elements
  19  # The first is the function to generate SQL statements (see adodb schema doc for more details)
  20  #  e.g., CreateTableSQL, DropTableSQL, ChangeTableSQL, RenameTableSQL, RenameColumnSQL,
  21  #  DropTableSQL, ChangeTableSQL, RenameTableSQL, RenameColumnSQL, AlterColumnSQL, DropColumnSQL
  22  #  A local function "InsertData" has been provided to add data to the db
  23  # The second parameter is an array of the parameters to be passed to the function.
  24  
  25  # An update identifier is inferred from the ordering of this table. ONLY ADD NEW CHANGES TO THE
  26  #  END OF THE TABLE!!!
  27  
  28  if ( !function_exists( 'db_null_date' ) ) {
  29  	function db_null_date() {
  30          return 0;
  31      }
  32  }
  33  
  34  
  35  function installer_db_now() {
  36          global $g_db;
  37  
  38         return $g_db->BindTimeStamp( time() );
  39  }
  40  
  41  $upgrade[] = Array('CreateTableSQL',Array(db_get_table( 'config' ),"
  42                config_id C(64) NOTNULL PRIMARY,
  43                project_id I DEFAULT '0' PRIMARY,
  44                user_id I DEFAULT '0' PRIMARY,
  45                access_reqd I DEFAULT '0',
  46                type I DEFAULT '90',
  47                value XL NOTNULL",
  48  Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
  49  $upgrade[] = Array('CreateIndexSQL',Array('idx_config',db_get_table( 'config' ),'config_id'));
  50  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bug_file'),"
  51    id             I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
  52    bug_id          I  UNSIGNED NOTNULL DEFAULT '0',
  53    title         C(250) NOTNULL DEFAULT \" '' \",
  54    description         C(250) NOTNULL DEFAULT \" '' \",
  55    diskfile         C(250) NOTNULL DEFAULT \" '' \",
  56    filename         C(250) NOTNULL DEFAULT \" '' \",
  57    folder         C(250) NOTNULL DEFAULT \" '' \",
  58    filesize          I NOTNULL DEFAULT '0',
  59    file_type         C(250) NOTNULL DEFAULT \" '' \",
  60    date_added         T NOTNULL DEFAULT '" . db_null_date() . "',
  61    content         B NOTNULL
  62    ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
  63  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_file_bug_id',db_get_table('bug_file'),'bug_id'));
  64  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bug_history'),"
  65    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
  66    user_id          I  UNSIGNED NOTNULL DEFAULT '0',
  67    bug_id          I  UNSIGNED NOTNULL DEFAULT '0',
  68    date_modified     T NOTNULL DEFAULT '" . db_null_date() . "',
  69    field_name         C(32) NOTNULL DEFAULT \" '' \",
  70    old_value         C(128) NOTNULL DEFAULT \" '' \",
  71    new_value         C(128) NOTNULL DEFAULT \" '' \",
  72    type             I2 NOTNULL DEFAULT '0'
  73    ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
  74  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_history_bug_id',db_get_table('bug_history'),'bug_id'));
  75  $upgrade[] = Array('CreateIndexSQL',Array('idx_history_user_id',db_get_table('bug_history'),'user_id'));
  76  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bug_monitor'),"
  77    user_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
  78    bug_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0'
  79  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
  80  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bug_relationship'),"
  81    id              I  UNSIGNED NOTNULL AUTOINCREMENT PRIMARY,
  82    source_bug_id         I  UNSIGNED NOTNULL DEFAULT '0',
  83    destination_bug_id      I  UNSIGNED NOTNULL DEFAULT '0',
  84    relationship_type     I2 NOTNULL DEFAULT '0'
  85  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
  86  $upgrade[] = Array('CreateIndexSQL',Array('idx_relationship_source',db_get_table('bug_relationship'),'source_bug_id'));
  87  /* 10 */
  88  $upgrade[] = Array('CreateIndexSQL',Array('idx_relationship_destination',db_get_table('bug_relationship'),'destination_bug_id'));
  89  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bug'),"
  90    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
  91    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
  92    reporter_id          I  UNSIGNED NOTNULL DEFAULT '0',
  93    handler_id          I  UNSIGNED NOTNULL DEFAULT '0',
  94    duplicate_id          I  UNSIGNED NOTNULL DEFAULT '0',
  95    priority         I2 NOTNULL DEFAULT '30',
  96    severity         I2 NOTNULL DEFAULT '50',
  97    reproducibility     I2 NOTNULL DEFAULT '10',
  98    status         I2 NOTNULL DEFAULT '10',
  99    resolution         I2 NOTNULL DEFAULT '10',
 100    projection         I2 NOTNULL DEFAULT '10',
 101    category         C(64) NOTNULL DEFAULT \" '' \",
 102    date_submitted     T NOTNULL DEFAULT '" . db_null_date() . "',
 103    last_updated         T NOTNULL DEFAULT '" . db_null_date() . "',
 104    eta             I2 NOTNULL DEFAULT '10',
 105    bug_text_id          I  UNSIGNED NOTNULL DEFAULT '0',
 106    os             C(32) NOTNULL DEFAULT \" '' \",
 107    os_build         C(32) NOTNULL DEFAULT \" '' \",
 108    platform         C(32) NOTNULL DEFAULT \" '' \",
 109    version         C(64) NOTNULL DEFAULT \" '' \",
 110    fixed_in_version     C(64) NOTNULL DEFAULT \" '' \",
 111    build         C(32) NOTNULL DEFAULT \" '' \",
 112    profile_id          I  UNSIGNED NOTNULL DEFAULT '0',
 113    view_state         I2 NOTNULL DEFAULT '10',
 114    summary         C(128) NOTNULL DEFAULT \" '' \",
 115    sponsorship_total      I  NOTNULL DEFAULT '0',
 116    sticky        L  NOTNULL DEFAULT  \"'0'\"
 117  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 118  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_sponsorship_total',db_get_table('bug'),'sponsorship_total'));
 119  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_fixed_in_version',db_get_table('bug'),'fixed_in_version'));
 120  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_status',db_get_table('bug'),'status'));
 121  $upgrade[] = Array('CreateIndexSQL',Array('idx_project',db_get_table('bug'),'project_id'));
 122  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bug_text'),"
 123    id              I  PRIMARY UNSIGNED NOTNULL AUTOINCREMENT,
 124    description         XL NOTNULL,
 125    steps_to_reproduce     XL NOTNULL,
 126    additional_information XL NOTNULL
 127  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 128  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bugnote'),"
 129    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
 130    bug_id          I  UNSIGNED NOTNULL DEFAULT '0',
 131    reporter_id          I  UNSIGNED NOTNULL DEFAULT '0',
 132    bugnote_text_id      I  UNSIGNED NOTNULL DEFAULT '0',
 133    view_state         I2 NOTNULL DEFAULT '10',
 134    date_submitted     T NOTNULL DEFAULT '" . db_null_date() . "',
 135    last_modified     T NOTNULL DEFAULT '" . db_null_date() . "',
 136    note_type          I  DEFAULT '0',
 137    note_attr         C(250) DEFAULT \" '' \"
 138  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 139  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug',db_get_table('bugnote'),'bug_id'));
 140  $upgrade[] = Array('CreateIndexSQL',Array('idx_last_mod',db_get_table('bugnote'),'last_modified'));
 141  /* 20 */
 142  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('bugnote_text'),"
 143    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 144    note             XL NOTNULL
 145  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 146  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('custom_field_project'),"
 147    field_id          I  NOTNULL PRIMARY DEFAULT '0',
 148    project_id          I  UNSIGNED PRIMARY NOTNULL DEFAULT '0',
 149    sequence         I2 NOTNULL DEFAULT '0'
 150  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 151  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('custom_field_string'),"
 152    field_id          I  NOTNULL PRIMARY DEFAULT '0',
 153    bug_id          I  NOTNULL PRIMARY DEFAULT '0',
 154    value         C(255) NOTNULL DEFAULT \" '' \"
 155  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 156  $upgrade[] = Array('CreateIndexSQL',Array('idx_custom_field_bug',db_get_table('custom_field_string'),'bug_id'));
 157  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('custom_field'),"
 158    id              I  NOTNULL PRIMARY AUTOINCREMENT,
 159    name             C(64) NOTNULL DEFAULT \" '' \",
 160    type             I2 NOTNULL DEFAULT '0',
 161    possible_values     C(255) NOTNULL DEFAULT \" '' \",
 162    default_value     C(255) NOTNULL DEFAULT \" '' \",
 163    valid_regexp         C(255) NOTNULL DEFAULT \" '' \",
 164    access_level_r     I2 NOTNULL DEFAULT '0',
 165    access_level_rw     I2 NOTNULL DEFAULT '0',
 166    length_min          I  NOTNULL DEFAULT '0',
 167    length_max          I  NOTNULL DEFAULT '0',
 168    advanced         L NOTNULL DEFAULT \" '0' \",
 169    require_report     L NOTNULL DEFAULT \" '0' \",
 170    require_update     L NOTNULL DEFAULT \" '0' \",
 171    display_report     L NOTNULL DEFAULT \" '0' \",
 172    display_update     L NOTNULL DEFAULT \" '1' \",
 173    require_resolved     L NOTNULL DEFAULT \" '0' \",
 174    display_resolved     L NOTNULL DEFAULT \" '0' \",
 175    display_closed     L NOTNULL DEFAULT \" '0' \",
 176    require_closed     L NOTNULL DEFAULT \" '0' \"
 177  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 178  $upgrade[] = Array('CreateIndexSQL',Array('idx_custom_field_name',db_get_table('custom_field'),'name'));
 179  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('filters'),"
 180    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 181    user_id          I  NOTNULL DEFAULT '0',
 182    project_id          I  NOTNULL DEFAULT '0',
 183    is_public         L DEFAULT NULL,
 184    name             C(64) NOTNULL DEFAULT \" '' \",
 185    filter_string     XL NOTNULL
 186  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 187  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('news'),"
 188    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
 189    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 190    poster_id          I  UNSIGNED NOTNULL DEFAULT '0',
 191    date_posted         T NOTNULL DEFAULT '" . db_null_date() . "',
 192    last_modified     T NOTNULL DEFAULT '" . db_null_date() . "',
 193    view_state         I2 NOTNULL DEFAULT '10',
 194    announcement         L NOTNULL DEFAULT \" '0' \",
 195    headline         C(64) NOTNULL DEFAULT \" '' \",
 196    body             XL NOTNULL
 197  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 198  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('project_category'),"
 199    project_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 200    category         C(64) NOTNULL PRIMARY DEFAULT \" '' \",
 201    user_id          I  UNSIGNED NOTNULL DEFAULT '0'
 202  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 203  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('project_file'),"
 204    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 205    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 206    title         C(250) NOTNULL DEFAULT \" '' \",
 207    description         C(250) NOTNULL DEFAULT \" '' \",
 208    diskfile         C(250) NOTNULL DEFAULT \" '' \",
 209    filename         C(250) NOTNULL DEFAULT \" '' \",
 210    folder         C(250) NOTNULL DEFAULT \" '' \",
 211    filesize          I NOTNULL DEFAULT '0',
 212    file_type         C(250) NOTNULL DEFAULT \" '' \",
 213    date_added         T NOTNULL DEFAULT '" . db_null_date() . "',
 214    content         B NOTNULL
 215  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 216  /* 30 */
 217  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('project_hierarchy'),"
 218                child_id I UNSIGNED NOTNULL,
 219                parent_id I UNSIGNED NOTNULL",
 220  Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 221  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('project'),"
 222    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
 223    name             C(128) NOTNULL DEFAULT \" '' \",
 224    status         I2 NOTNULL DEFAULT '10',
 225    enabled         L NOTNULL DEFAULT \" '1' \",
 226    view_state         I2 NOTNULL DEFAULT '10',
 227    access_min         I2 NOTNULL DEFAULT '10',
 228    file_path         C(250) NOTNULL DEFAULT \" '' \",
 229    description         XL NOTNULL
 230  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 231  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_id',db_get_table('project'),'id'));
 232  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_name',db_get_table('project'),'name',Array('UNIQUE')));
 233  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_view',db_get_table('project'),'view_state'));
 234  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('project_user_list'),"
 235    project_id          I  UNSIGNED PRIMARY NOTNULL DEFAULT '0',
 236    user_id          I  UNSIGNED PRIMARY NOTNULL DEFAULT '0',
 237    access_level         I2 NOTNULL DEFAULT '10'
 238  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 239  $upgrade[] = Array( 'CreateIndexSQL',Array('idx_project_user',db_get_table('project_user_list'),'user_id'));
 240  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('project_version'),"
 241    id              I  NOTNULL PRIMARY AUTOINCREMENT,
 242    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 243    version         C(64) NOTNULL DEFAULT \" '' \",
 244    date_order         T NOTNULL DEFAULT '" . db_null_date() . "',
 245    description         XL NOTNULL,
 246    released         L NOTNULL DEFAULT \" '1' \"
 247  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 248  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_version',db_get_table('project_version'),'project_id,version',Array('UNIQUE')));
 249  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('sponsorship'),"
 250    id              I  NOTNULL PRIMARY AUTOINCREMENT,
 251    bug_id          I  NOTNULL DEFAULT '0',
 252    user_id          I  NOTNULL DEFAULT '0',
 253    amount          I  NOTNULL DEFAULT '0',
 254    logo             C(128) NOTNULL DEFAULT \" '' \",
 255    url             C(128) NOTNULL DEFAULT \" '' \",
 256    paid             L NOTNULL DEFAULT \" '0' \",
 257    date_submitted     T NOTNULL DEFAULT '" . db_null_date() . "',
 258    last_updated         T NOTNULL DEFAULT '" . db_null_date() . "'
 259  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 260  /* 40 */
 261  $upgrade[] = Array('CreateIndexSQL',Array('idx_sponsorship_bug_id',db_get_table('sponsorship'),'bug_id'));
 262  $upgrade[] = Array('CreateIndexSQL',Array('idx_sponsorship_user_id',db_get_table('sponsorship'),'user_id'));
 263  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('tokens'),"
 264                id I NOTNULL PRIMARY AUTOINCREMENT,
 265                owner I NOTNULL,
 266                type I NOTNULL,
 267                timestamp T NOTNULL,
 268                expiry T,
 269                value XL NOTNULL",
 270  Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 271  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('user_pref'),"
 272    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 273    user_id          I  UNSIGNED NOTNULL DEFAULT '0',
 274    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 275    default_profile      I  UNSIGNED NOTNULL DEFAULT '0',
 276    default_project      I  UNSIGNED NOTNULL DEFAULT '0',
 277    advanced_report     L NOTNULL DEFAULT \" '0' \",
 278    advanced_view     L NOTNULL DEFAULT \" '0' \",
 279    advanced_update     L NOTNULL DEFAULT \" '0' \",
 280    refresh_delay      I  NOTNULL DEFAULT '0',
 281    redirect_delay     L NOTNULL DEFAULT \" '0' \",
 282    bugnote_order     C(4) NOTNULL DEFAULT 'ASC',
 283    email_on_new         L NOTNULL DEFAULT \" '0' \",
 284    email_on_assigned     L NOTNULL DEFAULT \" '0' \",
 285    email_on_feedback     L NOTNULL DEFAULT \" '0' \",
 286    email_on_resolved    L NOTNULL DEFAULT \" '0' \",
 287    email_on_closed     L NOTNULL DEFAULT \" '0' \",
 288    email_on_reopened     L NOTNULL DEFAULT \" '0' \",
 289    email_on_bugnote     L NOTNULL DEFAULT \" '0' \",
 290    email_on_status     L NOTNULL DEFAULT \" '0' \",
 291    email_on_priority     L NOTNULL DEFAULT \" '0' \",
 292    email_on_priority_min_severity     I2 NOTNULL DEFAULT '10',
 293    email_on_status_min_severity     I2 NOTNULL DEFAULT '10',
 294    email_on_bugnote_min_severity     I2 NOTNULL DEFAULT '10',
 295    email_on_reopened_min_severity     I2 NOTNULL DEFAULT '10',
 296    email_on_closed_min_severity     I2 NOTNULL DEFAULT '10',
 297    email_on_resolved_min_severity     I2 NOTNULL DEFAULT '10',
 298    email_on_feedback_min_severity    I2 NOTNULL DEFAULT '10',
 299    email_on_assigned_min_severity     I2 NOTNULL DEFAULT '10',
 300    email_on_new_min_severity     I2 NOTNULL DEFAULT '10',
 301    email_bugnote_limit     I2 NOTNULL DEFAULT '0',
 302    language         C(32) NOTNULL DEFAULT 'english'
 303  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 304  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('user_print_pref'),"
 305    user_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 306    print_pref         C(27) NOTNULL DEFAULT \" '' \"
 307  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 308  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('user_profile'),"
 309    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 310    user_id          I  UNSIGNED NOTNULL DEFAULT '0',
 311    platform         C(32) NOTNULL DEFAULT \" '' \",
 312    os             C(32) NOTNULL DEFAULT \" '' \",
 313    os_build         C(32) NOTNULL DEFAULT \" '' \",
 314    description         XL NOTNULL
 315  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 316  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('user'),"
 317    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 318    username         C(32) NOTNULL DEFAULT \" '' \",
 319    realname         C(64) NOTNULL DEFAULT \" '' \",
 320    email         C(64) NOTNULL DEFAULT \" '' \",
 321    password         C(32) NOTNULL DEFAULT \" '' \",
 322    date_created         T NOTNULL DEFAULT '" . db_null_date() . "',
 323    last_visit         T NOTNULL DEFAULT '" . db_null_date() . "',
 324    enabled        L NOTNULL DEFAULT \" '1' \",
 325    protected         L NOTNULL DEFAULT \" '0' \",
 326    access_level         I2 NOTNULL DEFAULT '10',
 327    login_count          I  NOTNULL DEFAULT '0',
 328    lost_password_request_count     I2 NOTNULL DEFAULT '0',
 329    failed_login_count     I2 NOTNULL DEFAULT '0',
 330    cookie_string     C(64) NOTNULL DEFAULT \" '' \"
 331  ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 332  $upgrade[] = Array('CreateIndexSQL',Array('idx_user_cookie_string',db_get_table('user'),'cookie_string',Array('UNIQUE')));
 333  $upgrade[] = Array('CreateIndexSQL',Array('idx_user_username',db_get_table('user'),'username',Array('UNIQUE')));
 334  $upgrade[] = Array('CreateIndexSQL',Array('idx_enable',db_get_table('user'),'enabled'));
 335  /* 50 */
 336  $upgrade[] = Array('CreateIndexSQL',Array('idx_access',db_get_table('user'),'access_level'));
 337  $upgrade[] = Array('InsertData', Array( db_get_table('user'),
 338      "(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
 339          ('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', '" . installer_db_now() . "', '" . installer_db_now() . "', '1', '0', 90, 3, 0, 0, '" .
 340               md5( mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ) ) . md5( time() ) . "')" ) );
 341  $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'bug_history' ), "old_value C(255) NOTNULL" ) );
 342  $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'bug_history' ), "new_value C(255) NOTNULL" ) );
 343  
 344  $upgrade[] = Array('CreateTableSQL',Array(db_get_table('email'),"
 345    email_id         I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 346    email             C(64) NOTNULL DEFAULT \" '' \",
 347    subject        C(250) NOTNULL DEFAULT \" '' \",
 348    submitted     T NOTNULL DEFAULT '" . db_null_date() . "',
 349    metadata         XL NOTNULL,
 350    body             XL NOTNULL
 351    ",Array('mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS')));
 352  $upgrade[] = Array('CreateIndexSQL',Array('idx_email_id',db_get_table('email'),'email_id'));
 353  $upgrade[] = Array('AddColumnSQL',Array(db_get_table('bug'), "target_version C(64) NOTNULL DEFAULT \" '' \""));
 354  $upgrade[] = Array('AddColumnSQL',Array(db_get_table('bugnote'), "time_tracking I UNSIGNED NOTNULL DEFAULT \" 0 \""));
 355  $upgrade[] = Array('CreateIndexSQL',Array('idx_diskfile',db_get_table('bug_file'),'diskfile'));
 356  $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'user_print_pref' ), "print_pref C(64) NOTNULL" ) );
 357  /* 60 */
 358  $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'bug_history' ), "field_name C(64) NOTNULL" ) );
 359  
 360  # Release marker: 1.1.0a4
 361  
 362  $upgrade[] = Array('CreateTableSQL', Array( db_get_table( 'tag' ), "
 363      id                I        UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 364      user_id            I        UNSIGNED NOTNULL DEFAULT '0',
 365      name            C(100)    NOTNULL PRIMARY DEFAULT \" '' \",
 366      description        XL        NOTNULL,
 367      date_created    T        NOTNULL DEFAULT '" . db_null_date() . "',
 368      date_updated    T        NOTNULL DEFAULT '" . db_null_date() . "'
 369      ", Array( 'mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS' ) ) );
 370  $upgrade[] = Array('CreateTableSQL', Array( db_get_table( 'bug_tag' ), "
 371      bug_id            I    UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 372      tag_id            I    UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 373      user_id            I    UNSIGNED NOTNULL DEFAULT '0',
 374      date_attached    T    NOTNULL DEFAULT '" . db_null_date() . "'
 375      ", Array( 'mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS' ) ) );
 376  
 377  $upgrade[] = Array('CreateIndexSQL', Array( 'idx_typeowner', db_get_table( 'tokens' ), 'type, owner' ) );
 378  
 379  # Release marker: 1.2.0-SVN
 380  
 381  $upgrade[] = Array('CreateTableSQL', Array( db_get_table( 'plugin' ), "
 382      basename        C(40)    NOTNULL PRIMARY,
 383      enabled            L        NOTNULL DEFAULT \" '0' \"
 384      ", Array( 'mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS' ) ) );
 385  
 386  $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'user_pref' ), "redirect_delay     I NOTNULL DEFAULT 0" ) );
 387  
 388  /* apparently mysql now has a STRICT mode, where setting a DEFAULT value on a blob/text is now an error, instead of being silently ignored */
 389  if ( isset( $f_db_type ) && ( $f_db_type == 'mysql' || $f_db_type == 'mysqli' ) ) {
 390      $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'custom_field' ), "possible_values X NOTNULL" ) );
 391  } else {
 392      $upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'custom_field' ), "possible_values X NOTNULL DEFAULT \" '' \"" ) );
 393  }
 394  
 395  $upgrade[] = Array( 'CreateTableSQL', Array( db_get_table( 'category' ), "
 396      id                I        UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 397      project_id        I        UNSIGNED NOTNULL DEFAULT '0',
 398      user_id            I        UNSIGNED NOTNULL DEFAULT '0',
 399      name            C(128)    NOTNULL DEFAULT \" '' \",
 400      status            I        UNSIGNED NOTNULL DEFAULT '0'
 401      ", Array( 'mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS' ) ) );
 402  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_category_project_name', db_get_table( 'category' ), 'project_id, name', array( 'UNIQUE' ) ) );
 403  $upgrade[] = Array( 'InsertData', Array( db_get_table( 'category' ), "
 404      ( project_id, user_id, name, status ) VALUES
 405      ( '0', '0', 'General', '0' ) " ) );
 406  /* 70 */
 407  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug' ), "category_id I UNSIGNED NOTNULL DEFAULT '1'" ) );
 408  $upgrade[] = Array( 'UpdateFunction', "category_migrate" );
 409  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug' ), "category" ) );
 410  $upgrade[] = Array( 'DropTableSQL', Array( db_get_table( 'project_category' ) ) );
 411  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project' ), "category_id I UNSIGNED NOTNULL DEFAULT '1'" ) );
 412  // remove unnecessary indexes
 413  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_id',db_get_table('project'),'id', array('DROP')), Array( 'db_index_exists', Array( db_get_table('project'), 'idx_project_id')));
 414  $upgrade[] = Array('CreateIndexSQL',Array('idx_config',db_get_table( 'config' ),'config_id', array('DROP')), Array( 'db_index_exists', Array( db_get_table('config'), 'idx_config')));
 415  
 416  $upgrade[] = Array( 'InsertData', Array( db_get_table( 'plugin' ), "
 417      ( basename, enabled ) VALUES
 418      ( 'MantisCoreFormatting', '1' )" ) );
 419  
 420  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project' ), "inherit_global I UNSIGNED NOTNULL DEFAULT '0'" ) );
 421  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project_hierarchy' ), "inherit_parent I UNSIGNED NOTNULL DEFAULT '0'" ) );
 422  /* 80 */
 423  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'plugin' ), "
 424      protected        L        NOTNULL DEFAULT \" '0' \",
 425      priority        I        UNSIGNED NOTNULL DEFAULT '3'
 426      " ) );
 427  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project_version' ), "
 428      obsolete        L        NOTNULL DEFAULT \" '0' \"" ) );
 429  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug' ), "
 430      due_date        T       NOTNULL DEFAULT '" . db_null_date() . "' " ) );
 431  
 432  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'custom_field' ), "
 433    filter_by         L         NOTNULL DEFAULT \" '1' \"" ) );
 434  $upgrade[] = Array( 'CreateTableSQL', Array( db_get_table( 'bug_revision' ), "
 435      id            I        UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 436      bug_id        I        UNSIGNED NOTNULL,
 437      bugnote_id    I        UNSIGNED NOTNULL DEFAULT '0',
 438      user_id        I        UNSIGNED NOTNULL,
 439      timestamp    T        NOTNULL DEFAULT '" . db_null_date() . "',
 440      type        I        UNSIGNED NOTNULL,
 441      value        XL        NOTNULL
 442      ", Array( 'mysql' => 'ENGINE=MyISAM DEFAULT CHARSET=utf8', 'pgsql' => 'WITHOUT OIDS' ) ) );
 443  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_bug_rev_id_time', db_get_table( 'bug_revision' ), 'bug_id, timestamp' ) );
 444  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_bug_rev_type', db_get_table( 'bug_revision' ), 'type' ) );
 445  
 446  #date conversion
 447  
 448  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug' ), "
 449      date_submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 450  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug' ), "
 451      due_date_int                    I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 452  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug' ), "
 453      last_updated_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 454  /* 90 */
 455  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'bug' ), 'id', array( 'date_submitted', 'due_date', 'last_updated' ), array( 'date_submitted_int', 'due_date_int', 'last_updated_int' ) ) );
 456  
 457  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug' ), "date_submitted" ) );
 458  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug' ), "date_submitted_int", "date_submitted", "date_submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 459  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug' ), "due_date" ) );
 460  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug' ), "due_date_int", "due_date", "due_date_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 461  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug' ), "last_updated" ) );
 462  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug' ), "last_updated_int", "last_updated", "last_updated_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 463  
 464  $upgrade[] = Array('CreateIndexSQL',Array('idx_last_mod',db_get_table( 'bugnote' ),'last_modified', array('DROP')), Array( 'db_index_exists', Array( db_get_table('bugnote'), 'idx_last_mod')));
 465  
 466  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bugnote' ), "
 467      last_modified_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 468  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bugnote' ), "
 469      date_submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 470  /* 100 */
 471  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'bugnote' ), 'id', array( 'last_modified', 'date_submitted' ), array( 'last_modified_int', 'date_submitted_int' ) ) );
 472  
 473  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bugnote' ), "last_modified" ) );
 474  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bugnote' ), "last_modified_int", "last_modified", "last_modified_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 475  $upgrade[] = Array('CreateIndexSQL',Array('idx_last_mod',db_get_table('bugnote'),'last_modified'));
 476  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bugnote' ), "date_submitted" ) );
 477  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bugnote' ), "date_submitted_int", "date_submitted", "date_submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 478  
 479  
 480  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug_file' ), "
 481      date_added_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 482  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'bug_file' ), 'id', 'date_added', 'date_added_int' ) );
 483  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug_file' ), "date_added" ) );
 484  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug_file' ), "date_added_int", "date_added", "date_added_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 485  /* 110 */
 486  
 487  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project_file' ), "
 488      date_added_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 489  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'project_file' ), 'id', 'date_added', 'date_added_int' ) );
 490  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'project_file' ), "date_added" ) );
 491  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'project_file' ), "date_added_int", "date_added", "date_added_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 492  
 493  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug_history' ), "
 494      date_modified_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 495  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'bug_history' ), 'id', 'date_modified', 'date_modified_int' ) );
 496  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug_history' ), "date_modified" ) );
 497  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug_history' ), "date_modified_int", "date_modified", "date_modified_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 498  
 499  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'user' ), "
 500      last_visit_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 501  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'user' ), "
 502      date_created_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 503  /* 120 */
 504  
 505  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'user' ), 'id', array( 'last_visit', 'date_created' ), array( 'last_visit_int', 'date_created_int' ) ) );
 506  
 507  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'user' ), "date_created" ) );
 508  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'user' ), "date_created_int", "date_created", "date_created_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 509  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'user' ), "last_visit" ) );
 510  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'user' ), "last_visit_int", "last_visit", "last_visit_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 511  
 512  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'email' ), "
 513      submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 514  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'email' ), 'email_id', 'submitted', 'submitted_int' ) );
 515  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'email' ), "submitted" ) );
 516  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'email' ), "submitted_int", "submitted", "submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 517  
 518  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'tag' ), "
 519      date_created_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 520  /* 130 */
 521  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'tag' ), "
 522      date_updated_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 523  
 524  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'tag' ), 'id', array( 'date_created', 'date_updated' ), array( 'date_created_int', 'date_updated_int' ) ) );
 525  
 526  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'tag' ), "date_created" ) );
 527  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'tag' ), "date_created_int", "date_created", "date_created_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 528  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'tag' ), "date_updated" ) );
 529  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'tag' ), "date_updated_int", "date_updated", "date_updated_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 530  
 531  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug_tag' ), "
 532      date_attached_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 533  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'bug_tag' ), 'bug_id', 'date_attached', 'date_attached_int' ) );
 534  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug_tag' ), "date_attached" ) );
 535  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug_tag' ), "date_attached_int", "date_attached", "date_attached_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 536  /* 140 */
 537  
 538  
 539  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'tokens' ), "
 540      timestamp_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 541  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'tokens' ), "
 542      expiry_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 543  
 544  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'tokens' ), 'id', array( 'timestamp', 'expiry' ), array( 'timestamp_int', 'expiry_int' ) ) );
 545  
 546  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'tokens' ), "timestamp" ) );
 547  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'tokens' ), "timestamp_int", "timestamp", "timestamp_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 548  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'tokens' ), "expiry" ) );
 549  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'tokens' ), "expiry_int", "expiry", "expiry_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 550  
 551  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'news' ), "
 552      last_modified_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 553  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'news' ), "
 554      date_posted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 555  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'news' ), 'id', array( 'date_posted', 'last_modified' ), array( 'date_posted_int', 'last_modified_int' ) ) );
 556  /* 150 */
 557  
 558  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'news' ), "last_modified" ) );
 559  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'news' ), "last_modified_int", "last_modified", "last_modified_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 560  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'news' ), "date_posted" ) );
 561  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'news' ), "date_posted_int", "date_posted", "date_posted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 562  
 563  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_rev_id_time',db_get_table( 'bug_revision' ),'bug_id, timestamp', array('DROP')), Array( 'db_index_exists', Array( db_get_table('bug_revision'), 'idx_bug_rev_id_time')));
 564  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug_revision' ), "
 565      timestamp_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 566  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'bug_revision' ), 'id', 'timestamp', 'timestamp_int' ) );
 567  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'bug_revision' ), "timestamp" ) );
 568  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'bug_revision' ), "timestamp_int", "timestamp", "timestamp_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 569  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_bug_rev_id_time', db_get_table( 'bug_revision' ), 'bug_id, timestamp' ) );
 570  /* 160 */
 571  
 572  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'user_pref' ), "
 573       timezone C(32) NOTNULL DEFAULT '' " ) );
 574  
 575  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project_version' ), "
 576      date_order_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 577  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'project_version' ), 'id', 'date_order', 'date_order_int' ) );
 578  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'project_version' ), "date_order" ) );
 579  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'project_version' ), "date_order_int", "date_order", "date_order_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 580  
 581  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'sponsorship' ), "
 582      date_submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 583  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'sponsorship' ), "
 584      last_updated_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 585  
 586  $upgrade[] = Array( 'UpdateFunction', "date_migrate", array( db_get_table( 'sponsorship' ), 'id', array( 'date_submitted', 'last_updated' ), array( 'date_submitted_int', 'last_updated_int' ) ) );
 587  
 588  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'sponsorship' ), "last_updated" ) );
 589  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'sponsorship' ), "last_updated_int", "last_updated", "last_updated_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 590  
 591  /* 170 */
 592  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'sponsorship' ), "date_submitted" ) );
 593  $upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'sponsorship' ), "date_submitted_int", "date_submitted", "date_submitted_int        I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
 594  
 595  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'project_file' ), "
 596      user_id            I        UNSIGNED NOTNULL DEFAULT '0' " ) );
 597  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'bug_file' ), "
 598      user_id        I              UNSIGNED NOTNULL DEFAULT '0' " ) );
 599  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'custom_field'), "advanced" ) );
 600  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'user_pref'), "advanced_report" ) );
 601  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'user_pref'), "advanced_view" ) );
 602  $upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'user_pref'), "advanced_update" ) );
 603  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_project_hierarchy_child_id', db_get_table( 'project_hierarchy' ), 'child_id' ) );
 604  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_project_hierarchy_parent_id', db_get_table( 'project_hierarchy' ), 'parent_id' ) );
 605  
 606  /* 180 */
 607  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_tag_name', db_get_table( 'tag' ), 'name' ) );
 608  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_bug_tag_tag_id', db_get_table( 'bug_tag' ), 'tag_id' ) );
 609  $upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_email_id', db_get_table( 'email' ), 'email_id', array( 'DROP' ) ), Array( 'db_index_exists', Array( db_get_table( 'email' ), 'idx_email_id') ) );
 610  $upgrade[] = Array( 'UpdateFunction', 'correct_multiselect_custom_fields_db_format' );
 611  $upgrade[] = Array( 'UpdateFunction', "stored_filter_migrate" );
 612  $upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'custom_field_string' ), "
 613      text        XL              NULL DEFAULT NULL " ) );


Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7