AddTableIndex('updatefile', 'author'); // Set the database version setVersion(); // Put that the upgrade is done in the log add_log("Upgrade done.", "upgrade-2-0"); return; } // 2.2 Upgrade if (isset($_GET['upgrade-2-2'])) { AddTableIndex('updatefile', 'author'); // We need to move the buildupdate build ids to the build2update table $query = pdo_query("SELECT buildid FROM buildupdate"); while ($query_array = pdo_fetch_array($query)) { pdo_query("INSERT INTO build2update (buildid,updateid) VALUES ('" . $query_array['buildid'] . "','" . $query_array['buildid'] . "')"); } RemoveTableIndex("buildupdate", "buildid"); RenameTableField("buildupdate", "buildid", "id", "int(11)", "bigint", "0"); AddTablePrimaryKey("buildupdate", "id"); ModifyTableField("buildupdate", "id", "int(11)", "bigint", "", true, true); RenameTableField("updatefile", "buildid", "updateid", "int(11)", "bigint", "0"); AddTableField('site', 'outoforder', 'tinyint(1)', 'smallint', '0'); // Set the database version setVersion(); // Put that the upgrade is done in the log add_log("Upgrade done.", "upgrade-2-2"); return; } // 2.4 Upgrade if (isset($_GET['upgrade-2-4'])) { // Support for subproject groups AddTableField('subproject', 'groupid', 'int(11)', 'bigint', '0');
AddTableIndex('updatefile', 'author'); // Set the database version setVersion(); // Put that the upgrade is done in the log add_log('Upgrade done.', 'upgrade-2-0'); return; } // 2.2 Upgrade if (isset($_GET['upgrade-2-2'])) { AddTableIndex('updatefile', 'author'); // We need to move the buildupdate build ids to the build2update table $query = pdo_query('SELECT buildid FROM buildupdate'); while ($query_array = pdo_fetch_array($query)) { pdo_query("INSERT INTO build2update (buildid,updateid) VALUES ('" . $query_array['buildid'] . "','" . $query_array['buildid'] . "')"); } RemoveTableIndex('buildupdate', 'buildid'); RenameTableField('buildupdate', 'buildid', 'id', 'int(11)', 'bigint', '0'); AddTablePrimaryKey('buildupdate', 'id'); ModifyTableField('buildupdate', 'id', 'int(11)', 'bigint', '', true, true); RenameTableField('updatefile', 'buildid', 'updateid', 'int(11)', 'bigint', '0'); AddTableField('site', 'outoforder', 'tinyint(1)', 'smallint', '0'); // Set the database version setVersion(); // Put that the upgrade is done in the log add_log('Upgrade done.', 'upgrade-2-2'); return; } // 2.4 Upgrade if (isset($_GET['upgrade-2-4'])) { // Support for subproject groups AddTableField('subproject', 'groupid', 'int(11)', 'bigint', '0');