Skip to content

Commit

Permalink
recreate index, and fix installer for removal of db_now
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed May 17, 2009
1 parent c5e4a3a commit 756deda
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion admin/schema.php
Expand Up @@ -31,6 +31,13 @@ function db_null_date() {
}
}


function installer_db_now() {
global $g_db;

return $g_db->BindTimeStamp( time() );
}

$upgrade[] = Array('CreateTableSQL',Array(db_get_table( 'mantis_config_table' ),"
config_id C(64) NOTNULL PRIMARY,
project_id I DEFAULT '0' PRIMARY,
Expand Down Expand Up @@ -324,7 +331,7 @@ function db_null_date() {
$upgrade[] = Array('CreateIndexSQL',Array('idx_access',db_get_table('mantis_user_table'),'access_level'));
$upgrade[] = Array('InsertData', Array( db_get_table('mantis_user_table'),
"(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', '" . db_now() . "', '" . db_now() . "', '1', '0', 90, 3, 0, 0, '" .
('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', '" . installer_db_now() . "', '" . installer_db_now() . "', '1', '0', 90, 3, 0, 0, '" .
md5( mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ) ) . md5( time() ) . "')" ) );
$upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'mantis_bug_history_table' ), "old_value C(255) NOTNULL" ) );
$upgrade[] = Array('AlterColumnSQL', Array( db_get_table( 'mantis_bug_history_table' ), "new_value C(255) NOTNULL" ) );
Expand Down Expand Up @@ -540,8 +547,14 @@ function db_null_date() {
$upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'mantis_news_table' ), "date_posted" ) );
$upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'mantis_news_table' ), "date_posted_int", "date_posted", "date_posted_int I UNSIGNED NOTNULL DEFAULT '1' " ) );

$upgrade[] = Array('CreateIndexSQL',Array('idx_bug_rev_id_time',db_get_table( 'mantis_bug_revision_table' ),'bug_id, timestamp', array('DROP')), Array( 'db_index_exists', Array( db_get_table('mantis_bug_revision_table'), 'idx_bug_rev_id_time')));
$upgrade[] = Array( 'AddColumnSQL', Array( db_get_table( 'mantis_bug_revision_table' ), "
timestamp_int I UNSIGNED NOTNULL DEFAULT '1' " ) );
$upgrade[] = Array( 'UpdateFunction', "date_migrate", array( 'mantis_bug_revision_table', 'id', 'timestamp', 'timestamp_int' ) );
$upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'mantis_bug_revision_table' ), "timestamp" ) );
$upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'mantis_bug_revision_table' ), "timestamp_int", "timestamp", "timestamp_int I UNSIGNED NOTNULL DEFAULT '1' " ) );
$upgrade[] = Array( 'CreateIndexSQL', Array( 'idx_bug_rev_id_time', db_get_table( 'mantis_bug_revision_table' ), 'bug_id, timestamp' ) );




0 comments on commit 756deda

Please sign in to comment.