Example #1
0
    AddTableIndex('subproject', 'groupid');
    RemoveTableField("subproject", "core");
    RemoveTableField('project', 'coveragethreshold2');
    // Support for larger types
    ModifyTableField("buildfailure", "workingdirectory", "VARCHAR( 512)", "VARCHAR( 512 )", "", true, false);
    ModifyTableField("buildfailure", "outputfile", "VARCHAR( 512)", "VARCHAR( 512 )", "", true, false);
    // Support for parent builds
    AddTableField('build', 'parentid', 'int(11)', 'int', '0');
    AddTableIndex('build', 'parentid');
    // Cache configure results similar to build & test
    AddTableField('build', 'configureerrors', 'smallint(6)', 'smallint', '-1');
    AddTableField('build', 'configurewarnings', 'smallint(6)', 'smallint', '-1');
    // Add new multi-column index to build table.
    // This improves the rendering speed of overview.php.
    $multi_index = array("projectid", "parentid", "starttime");
    AddTableIndex("build", $multi_index);
    // Support for dynamic BuildGroups.
    AddTableField('buildgroup', 'type', 'varchar(20)', 'character varying(20)', 'Daily');
    AddTableField('build2grouprule', 'parentgroupid', 'int(11)', 'bigint', '0');
    // Support for pull request notifications.
    AddTableField('build', 'notified', 'tinyint(1)', 'smallint', '0');
    // Better caching of buildfailures.
    UpgradeBuildFailureTable('buildfailure', 'buildfailuredetails');
    // Set the database version
    setVersion();
    // Put that the upgrade is done in the log
    add_log("Upgrade done.", "upgrade-2-4");
    return;
}
// When adding new tables they should be added to the SQL installation file
// and here as well
Example #2
0
            pdo_query('ALTER TABLE subproject ADD UNIQUE (name, projectid, endtime)');
            pdo_query('CREATE INDEX "subproject_unique2" ON "subproject" ("name", "projectid", "endtime")');
        } else {
            pdo_query('ALTER TABLE subproject ADD UNIQUE KEY (name, projectid, endtime)');
        }
    }
    // Support for subproject path.
    AddTableField('subproject', 'path', 'varchar(512)', 'character varying(512)', '');
    // Remove the errorlog from the DB (we're all log files now).
    pdo_query('DROP TABLE IF EXISTS errorlog');
    // Option to pass label filters from index.php to test pages.
    AddTableField('project', 'sharelabelfilters', 'tinyint(1)', 'smallint', '0');
    // Summarize the number of dynamic analysis defects each build found.
    PopulateDynamicAnalysisSummaryTable();
    // Add index to buildupdate::revision in support of this filter.
    AddTableIndex('buildupdate', 'revision');
    // Store CTEST_CHANGE_ID in the build table.
    AddTableField('build', 'changeid', 'varchar(40)', 'character varying(40)', '');
    // Add unique constraints to the *diff tables.
    AddUniqueConstraintToDiffTables();
    // Set the database version
    setVersion();
    // Put that the upgrade is done in the log
    add_log('Upgrade done.', 'upgrade-2-4');
    return;
}
// When adding new tables they should be added to the SQL installation file
// and here as well
if ($Upgrade) {
    // check if the backup directory is writable
    if (!is_writable($CDASH_BACKUP_DIRECTORY)) {