[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/ -> schema.php (source)

   1  <?php
   2  # Mantis - a php based bugtracking system
   3  
   4  # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   5  # Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   6  
   7  # Mantis is free software: you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation, either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Mantis is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
  19      # --------------------------------------------------------
  20      # $Id: schema.php,v 1.23.2.1 2007-10-13 22:34:56 giallu Exp $
  21      # --------------------------------------------------------
  22      
  23      # Each entry below defines the schema. The upgrade array consists of
  24      #  two elements
  25      # The first is the function to generate SQL statements (see adodb schema doc for more details)
  26      #  e.g., CreateTableSQL, DropTableSQL, ChangeTableSQL, RenameTableSQL, RenameColumnSQL,
  27      #  DropTableSQL, ChangeTableSQL, RenameTableSQL, RenameColumnSQL, AlterColumnSQL, DropColumnSQL
  28      #  A local function "InsertData" has been provided to add data to the db
  29      # The second parameter is an array of the parameters to be passed to the function.
  30      
  31      # An update identifier is inferred from the ordering of this table. ONLY ADD NEW CHANGES TO THE 
  32      #  END OF THE TABLE!!!
  33  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_config_table'),"
  34                config_id C(64) NOTNULL PRIMARY,
  35                project_id I DEFAULT '0' PRIMARY,
  36                user_id I DEFAULT '0' PRIMARY,
  37                access_reqd I DEFAULT '0',
  38                type I DEFAULT '90',
  39                value XL NOTNULL",
  40  Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
  41  $upgrade[] = Array('CreateIndexSQL',Array('idx_config',config_get('mantis_config_table'),'config_id'));
  42  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bug_file_table'),"
  43    id             I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
  44    bug_id          I  UNSIGNED NOTNULL DEFAULT '0',
  45    title         C(250) NOTNULL DEFAULT \" '' \",
  46    description         C(250) NOTNULL DEFAULT \" '' \",
  47    diskfile         C(250) NOTNULL DEFAULT \" '' \",
  48    filename         C(250) NOTNULL DEFAULT \" '' \",
  49    folder         C(250) NOTNULL DEFAULT \" '' \",
  50    filesize          I NOTNULL DEFAULT '0',
  51    file_type         C(250) NOTNULL DEFAULT \" '' \",
  52    date_added         T NOTNULL DEFAULT '1970-01-01 00:00:01',
  53    content         B NOTNULL
  54    ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
  55  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_file_bug_id',config_get('mantis_bug_file_table'),'bug_id'));
  56  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bug_history_table'),"
  57    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
  58    user_id          I  UNSIGNED NOTNULL DEFAULT '0',
  59    bug_id          I  UNSIGNED NOTNULL DEFAULT '0',
  60    date_modified     T NOTNULL DEFAULT '1970-01-01 00:00:01',
  61    field_name         C(32) NOTNULL DEFAULT \" '' \",
  62    old_value         C(128) NOTNULL DEFAULT \" '' \",
  63    new_value         C(128) NOTNULL DEFAULT \" '' \",
  64    type             I2 NOTNULL DEFAULT '0'
  65    ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
  66  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_history_bug_id',config_get('mantis_bug_history_table'),'bug_id'));
  67  $upgrade[] = Array('CreateIndexSQL',Array('idx_history_user_id',config_get('mantis_bug_history_table'),'user_id'));
  68  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bug_monitor_table'),"
  69    user_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
  70    bug_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0'
  71  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
  72  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bug_relationship_table'),"
  73    id              I  UNSIGNED NOTNULL AUTOINCREMENT PRIMARY,
  74    source_bug_id         I  UNSIGNED NOTNULL DEFAULT '0',
  75    destination_bug_id      I  UNSIGNED NOTNULL DEFAULT '0',
  76    relationship_type     I2 NOTNULL DEFAULT '0'
  77  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
  78  $upgrade[] = Array('CreateIndexSQL',Array('idx_relationship_source',config_get('mantis_bug_relationship_table'),'source_bug_id'));
  79  $upgrade[] = Array('CreateIndexSQL',Array('idx_relationship_destination',config_get('mantis_bug_relationship_table'),'destination_bug_id'));
  80  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bug_table'),"
  81    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
  82    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
  83    reporter_id          I  UNSIGNED NOTNULL DEFAULT '0',
  84    handler_id          I  UNSIGNED NOTNULL DEFAULT '0',
  85    duplicate_id          I  UNSIGNED NOTNULL DEFAULT '0',
  86    priority         I2 NOTNULL DEFAULT '30',
  87    severity         I2 NOTNULL DEFAULT '50',
  88    reproducibility     I2 NOTNULL DEFAULT '10',
  89    status         I2 NOTNULL DEFAULT '10',
  90    resolution         I2 NOTNULL DEFAULT '10',
  91    projection         I2 NOTNULL DEFAULT '10',
  92    category         C(64) NOTNULL DEFAULT \" '' \",
  93    date_submitted     T NOTNULL DEFAULT '1970-01-01 00:00:01',
  94    last_updated         T NOTNULL DEFAULT '1970-01-01 00:00:01',
  95    eta             I2 NOTNULL DEFAULT '10',
  96    bug_text_id          I  UNSIGNED NOTNULL DEFAULT '0',
  97    os             C(32) NOTNULL DEFAULT \" '' \",
  98    os_build         C(32) NOTNULL DEFAULT \" '' \",
  99    platform         C(32) NOTNULL DEFAULT \" '' \",
 100    version         C(64) NOTNULL DEFAULT \" '' \",
 101    fixed_in_version     C(64) NOTNULL DEFAULT \" '' \",
 102    build         C(32) NOTNULL DEFAULT \" '' \",
 103    profile_id          I  UNSIGNED NOTNULL DEFAULT '0',
 104    view_state         I2 NOTNULL DEFAULT '10',
 105    summary         C(128) NOTNULL DEFAULT \" '' \",
 106    sponsorship_total      I  NOTNULL DEFAULT '0',
 107    sticky        L  NOTNULL DEFAULT '0'
 108  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 109  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_sponsorship_total',config_get('mantis_bug_table'),'sponsorship_total'));
 110  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_fixed_in_version',config_get('mantis_bug_table'),'fixed_in_version'));
 111  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug_status',config_get('mantis_bug_table'),'status'));
 112  $upgrade[] = Array('CreateIndexSQL',Array('idx_project',config_get('mantis_bug_table'),'project_id'));
 113  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bug_text_table'),"
 114    id              I  PRIMARY UNSIGNED NOTNULL AUTOINCREMENT,
 115    description         XL NOTNULL,
 116    steps_to_reproduce     XL NOTNULL,
 117    additional_information XL NOTNULL
 118  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 119  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bugnote_table'),"
 120    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
 121    bug_id          I  UNSIGNED NOTNULL DEFAULT '0',
 122    reporter_id          I  UNSIGNED NOTNULL DEFAULT '0',
 123    bugnote_text_id      I  UNSIGNED NOTNULL DEFAULT '0',
 124    view_state         I2 NOTNULL DEFAULT '10',
 125    date_submitted     T NOTNULL DEFAULT '1970-01-01 00:00:01',
 126    last_modified     T NOTNULL DEFAULT '1970-01-01 00:00:01',
 127    note_type          I  DEFAULT '0',
 128    note_attr         C(250) DEFAULT \" '' \"
 129  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 130  $upgrade[] = Array('CreateIndexSQL',Array('idx_bug',config_get('mantis_bugnote_table'),'bug_id'));
 131  $upgrade[] = Array('CreateIndexSQL',Array('idx_last_mod',config_get('mantis_bugnote_table'),'last_modified'));
 132  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_bugnote_text_table'),"
 133    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 134    note             XL NOTNULL
 135  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 136  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_custom_field_project_table'),"
 137    field_id          I  NOTNULL PRIMARY DEFAULT '0',
 138    project_id          I  UNSIGNED PRIMARY NOTNULL DEFAULT '0',
 139    sequence         I2 NOTNULL DEFAULT '0'
 140  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 141  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_custom_field_string_table'),"
 142    field_id          I  NOTNULL PRIMARY DEFAULT '0',
 143    bug_id          I  NOTNULL PRIMARY DEFAULT '0',
 144    value         C(255) NOTNULL DEFAULT \" '' \"
 145  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 146  $upgrade[] = Array('CreateIndexSQL',Array('idx_custom_field_bug',config_get('mantis_custom_field_string_table'),'bug_id'));
 147  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_custom_field_table'),"
 148    id              I  NOTNULL PRIMARY AUTOINCREMENT,
 149    name             C(64) NOTNULL DEFAULT \" '' \",
 150    type             I2 NOTNULL DEFAULT '0',
 151    possible_values     C(255) NOTNULL DEFAULT \" '' \",
 152    default_value     C(255) NOTNULL DEFAULT \" '' \",
 153    valid_regexp         C(255) NOTNULL DEFAULT \" '' \",
 154    access_level_r     I2 NOTNULL DEFAULT '0',
 155    access_level_rw     I2 NOTNULL DEFAULT '0',
 156    length_min          I  NOTNULL DEFAULT '0',
 157    length_max          I  NOTNULL DEFAULT '0',
 158    advanced         L NOTNULL DEFAULT '0',
 159    require_report     L NOTNULL DEFAULT '0',
 160    require_update     L NOTNULL DEFAULT '0',
 161    display_report     L NOTNULL DEFAULT '1',
 162    display_update     L NOTNULL DEFAULT '1',
 163    require_resolved     L NOTNULL DEFAULT '0',
 164    display_resolved     L NOTNULL DEFAULT '0',
 165    display_closed     L NOTNULL DEFAULT '0',
 166    require_closed     L NOTNULL DEFAULT '0'
 167  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 168  $upgrade[] = Array('CreateIndexSQL',Array('idx_custom_field_name',config_get('mantis_custom_field_table'),'name'));
 169  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_filters_table'),"
 170    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 171    user_id          I  NOTNULL DEFAULT '0',
 172    project_id          I  NOTNULL DEFAULT '0',
 173    is_public         L DEFAULT NULL,
 174    name             C(64) NOTNULL DEFAULT \" '' \",
 175    filter_string     XL NOTNULL
 176  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 177  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_news_table'),"
 178    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
 179    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 180    poster_id          I  UNSIGNED NOTNULL DEFAULT '0',
 181    date_posted         T NOTNULL DEFAULT '1970-01-01 00:00:01',
 182    last_modified     T NOTNULL DEFAULT '1970-01-01 00:00:01',
 183    view_state         I2 NOTNULL DEFAULT '10',
 184    announcement         L NOTNULL DEFAULT '0',
 185    headline         C(64) NOTNULL DEFAULT \" '' \",
 186    body             XL NOTNULL
 187  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 188  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_category_table'),"
 189    project_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 190    category         C(64) NOTNULL PRIMARY DEFAULT \" '' \",
 191    user_id          I  UNSIGNED NOTNULL DEFAULT '0'
 192  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 193  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_file_table'),"
 194    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 195    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 196    title         C(250) NOTNULL DEFAULT \" '' \",
 197    description         C(250) NOTNULL DEFAULT \" '' \",
 198    diskfile         C(250) NOTNULL DEFAULT \" '' \",
 199    filename         C(250) NOTNULL DEFAULT \" '' \",
 200    folder         C(250) NOTNULL DEFAULT \" '' \",
 201    filesize          I NOTNULL DEFAULT '0',
 202    file_type         C(250) NOTNULL DEFAULT \" '' \",
 203    date_added         T NOTNULL DEFAULT '1970-01-01 00:00:01',
 204    content         B NOTNULL
 205  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 206  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_hierarchy_table'),"
 207                child_id I UNSIGNED NOTNULL,
 208                parent_id I UNSIGNED NOTNULL",
 209  Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 210  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_table'),"
 211    id              I  UNSIGNED PRIMARY NOTNULL AUTOINCREMENT,
 212    name             C(128) NOTNULL DEFAULT \" '' \",
 213    status         I2 NOTNULL DEFAULT '10',
 214    enabled         L NOTNULL DEFAULT '1',
 215    view_state         I2 NOTNULL DEFAULT '10',
 216    access_min         I2 NOTNULL DEFAULT '10',
 217    file_path         C(250) NOTNULL DEFAULT \" '' \",
 218    description         XL NOTNULL
 219  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 220  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_id',config_get('mantis_project_table'),'id'));
 221  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_name',config_get('mantis_project_table'),'name',Array('UNIQUE')));
 222  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_view',config_get('mantis_project_table'),'view_state'));
 223  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_user_list_table'),"
 224    project_id          I  UNSIGNED PRIMARY NOTNULL DEFAULT '0',
 225    user_id          I  UNSIGNED PRIMARY NOTNULL DEFAULT '0',
 226    access_level         I2 NOTNULL DEFAULT '10'
 227  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 228  $upgrade[] = Array( 'CreateIndexSQL',Array('idx_project_user',config_get('mantis_project_user_list_table'),'user_id'));
 229  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_project_version_table'),"
 230    id              I  NOTNULL PRIMARY AUTOINCREMENT,
 231    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 232    version         C(64) NOTNULL DEFAULT \" '' \",
 233    date_order         T NOTNULL DEFAULT '1970-01-01 00:00:01',
 234    description         XL NOTNULL,
 235    released         L NOTNULL DEFAULT '1'
 236  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 237  $upgrade[] = Array('CreateIndexSQL',Array('idx_project_version',config_get('mantis_project_version_table'),'project_id,version',Array('UNIQUE')));
 238  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_sponsorship_table'),"
 239    id              I  NOTNULL PRIMARY AUTOINCREMENT,
 240    bug_id          I  NOTNULL DEFAULT '0',
 241    user_id          I  NOTNULL DEFAULT '0',
 242    amount          I  NOTNULL DEFAULT '0',
 243    logo             C(128) NOTNULL DEFAULT \" '' \",
 244    url             C(128) NOTNULL DEFAULT \" '' \",
 245    paid             L NOTNULL DEFAULT '0',
 246    date_submitted     T NOTNULL DEFAULT '1970-01-01 00:00:01',
 247    last_updated         T NOTNULL DEFAULT '1970-01-01 00:00:01'
 248  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 249  $upgrade[] = Array('CreateIndexSQL',Array('idx_sponsorship_bug_id',config_get('mantis_sponsorship_table'),'bug_id'));
 250  $upgrade[] = Array('CreateIndexSQL',Array('idx_sponsorship_user_id',config_get('mantis_sponsorship_table'),'user_id'));
 251  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_tokens_table'),"
 252                id I NOTNULL PRIMARY AUTOINCREMENT,
 253                owner I NOTNULL,
 254                type I NOTNULL,
 255                timestamp T NOTNULL,
 256                expiry T,
 257                value XL NOTNULL",
 258  Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 259  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_user_pref_table'),"
 260    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 261    user_id          I  UNSIGNED NOTNULL DEFAULT '0',
 262    project_id          I  UNSIGNED NOTNULL DEFAULT '0',
 263    default_profile      I  UNSIGNED NOTNULL DEFAULT '0',
 264    default_project      I  UNSIGNED NOTNULL DEFAULT '0',
 265    advanced_report     L NOTNULL DEFAULT '0',
 266    advanced_view     L NOTNULL DEFAULT '0',
 267    advanced_update     L NOTNULL DEFAULT '0',
 268    refresh_delay      I  NOTNULL DEFAULT '0',
 269    redirect_delay     L NOTNULL DEFAULT '0',
 270    bugnote_order     C(4) NOTNULL DEFAULT 'ASC',
 271    email_on_new         L NOTNULL DEFAULT '0',
 272    email_on_assigned     L NOTNULL DEFAULT '0',
 273    email_on_feedback     L NOTNULL DEFAULT '0',
 274    email_on_resolved    L NOTNULL DEFAULT '0',
 275    email_on_closed     L NOTNULL DEFAULT '0',
 276    email_on_reopened     L NOTNULL DEFAULT '0',
 277    email_on_bugnote     L NOTNULL DEFAULT '0',
 278    email_on_status     L NOTNULL DEFAULT '0',
 279    email_on_priority     L NOTNULL DEFAULT '0',
 280    email_on_priority_min_severity     I2 NOTNULL DEFAULT '10',
 281    email_on_status_min_severity     I2 NOTNULL DEFAULT '10',
 282    email_on_bugnote_min_severity     I2 NOTNULL DEFAULT '10',
 283    email_on_reopened_min_severity     I2 NOTNULL DEFAULT '10',
 284    email_on_closed_min_severity     I2 NOTNULL DEFAULT '10',
 285    email_on_resolved_min_severity     I2 NOTNULL DEFAULT '10',
 286    email_on_feedback_min_severity    I2 NOTNULL DEFAULT '10',
 287    email_on_assigned_min_severity     I2 NOTNULL DEFAULT '10',
 288    email_on_new_min_severity     I2 NOTNULL DEFAULT '10',
 289    email_bugnote_limit     I2 NOTNULL DEFAULT '0',
 290    language         C(32) NOTNULL DEFAULT 'english'
 291  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 292  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_user_print_pref_table'),"
 293    user_id          I  UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 294    print_pref         C(27) NOTNULL DEFAULT \" '' \"
 295  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 296  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_user_profile_table'),"
 297    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 298    user_id          I  UNSIGNED NOTNULL DEFAULT '0',
 299    platform         C(32) NOTNULL DEFAULT \" '' \",
 300    os             C(32) NOTNULL DEFAULT \" '' \",
 301    os_build         C(32) NOTNULL DEFAULT \" '' \",
 302    description         XL NOTNULL
 303  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 304  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_user_table'),"
 305    id              I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 306    username         C(32) NOTNULL DEFAULT \" '' \",
 307    realname         C(64) NOTNULL DEFAULT \" '' \",
 308    email         C(64) NOTNULL DEFAULT \" '' \",
 309    password         C(32) NOTNULL DEFAULT \" '' \",
 310    date_created         T NOTNULL DEFAULT '1970-01-01 00:00:01',
 311    last_visit         T NOTNULL DEFAULT '1970-01-01 00:00:01',
 312    enabled        L NOTNULL DEFAULT '1',
 313    protected         L NOTNULL DEFAULT '0',
 314    access_level         I2 NOTNULL DEFAULT '10',
 315    login_count          I  NOTNULL DEFAULT '0',
 316    lost_password_request_count     I2 NOTNULL DEFAULT '0',
 317    failed_login_count     I2 NOTNULL DEFAULT '0',
 318    cookie_string     C(64) NOTNULL DEFAULT \" '' \"
 319  ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 320  $upgrade[] = Array('CreateIndexSQL',Array('idx_user_cookie_string',config_get('mantis_user_table'),'cookie_string',Array('UNIQUE')));
 321  $upgrade[] = Array('CreateIndexSQL',Array('idx_user_username',config_get('mantis_user_table'),'username',Array('UNIQUE')));
 322  $upgrade[] = Array('CreateIndexSQL',Array('idx_enable',config_get('mantis_user_table'),'enabled'));
 323  $upgrade[] = Array('CreateIndexSQL',Array('idx_access',config_get('mantis_user_table'),'access_level'));
 324  $upgrade[] = Array('InsertData', Array( config_get('mantis_user_table'), 
 325      "(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES 
 326          ('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', " . db_now() . ", " . db_now() . ", 1, 0, 90, 3, 0, 0, '" . 
 327               md5( mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ) ) . md5( time() ) . "')" ) );
 328  $upgrade[] = Array('AlterColumnSQL', Array( config_get( 'mantis_bug_history_table' ), "old_value C(255) NOTNULL" ) );
 329  $upgrade[] = Array('AlterColumnSQL', Array( config_get( 'mantis_bug_history_table' ), "new_value C(255) NOTNULL" ) );
 330  
 331  $upgrade[] = Array('CreateTableSQL',Array(config_get('mantis_email_table'),"
 332    email_id         I  UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 333    email             C(64) NOTNULL DEFAULT \" '' \",
 334    subject        C(250) NOTNULL DEFAULT \" '' \",
 335    submitted     T NOTNULL DEFAULT '1970-01-01 00:00:01',
 336    metadata         XL NOTNULL,
 337    body             XL NOTNULL
 338    ",Array('mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS')));
 339  $upgrade[] = Array('CreateIndexSQL',Array('idx_email_id',config_get('mantis_email_table'),'email_id'));
 340  $upgrade[] = Array('AddColumnSQL',Array(config_get('mantis_bug_table'), "target_version C(64) NOTNULL DEFAULT \" '' \""));
 341  $upgrade[] = Array('AddColumnSQL',Array(config_get('mantis_bugnote_table'), "time_tracking I UNSIGNED NOTNULL DEFAULT \" 0 \""));
 342  $upgrade[] = Array('CreateIndexSQL',Array('idx_diskfile',config_get('mantis_bug_file_table'),'diskfile'));
 343  $upgrade[] = Array('AlterColumnSQL', Array( config_get( 'mantis_user_print_pref_table' ), "print_pref C(64) NOTNULL" ) );
 344  $upgrade[] = Array('AlterColumnSQL', Array( config_get( 'mantis_bug_history_table' ), "field_name C(64) NOTNULL" ) );
 345  
 346  # Release marker: 1.1.0a4
 347  
 348  $upgrade[] = Array('CreateTableSQL', Array( config_get( 'mantis_tag_table' ), "
 349      id                I        UNSIGNED NOTNULL PRIMARY AUTOINCREMENT,
 350      user_id            I        UNSIGNED NOTNULL DEFAULT '0',
 351      name            C(100)    NOTNULL PRIMARY DEFAULT \" '' \",
 352      description        XL        NOTNULL,
 353      date_created    T        NOTNULL DEFAULT '1970-01-01 00:00:01',
 354      date_updated    T        NOTNULL DEFAULT '1970-01-01 00:00:01'
 355      ", Array( 'mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS' ) ) );
 356  $upgrade[] = Array('CreateTableSQL', Array( config_get( 'mantis_bug_tag_table' ), "
 357      bug_id            I    UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 358      tag_id            I    UNSIGNED NOTNULL PRIMARY DEFAULT '0',
 359      user_id            I    UNSIGNED NOTNULL DEFAULT '0',
 360      date_attached    T    NOTNULL DEFAULT '1970-01-01 00:00:01'
 361      ", Array( 'mysql' => 'TYPE=MyISAM', 'pgsql' => 'WITHOUT OIDS' ) ) );
 362  
 363  $upgrade[] = Array('CreateIndexSQL', Array( 'idx_typeowner', config_get( 'mantis_tokens_table' ), 'type, owner' ) );
 364  ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics