. */ error_reporting(E_ALL); ini_set('display_errors', 1); require('../conf.php'); function lower_version($that, $new) { $that = explode('.', $that); $new = explode('.', $new); while (count($that) < count($new)) $that[] = 0; while (count($new) < count($that)) $new[] = 0; for ($i = 0; $i < count($new); $i++) { if ($new[$i] > $that[$i]) { return true; } } return false; } if (isset($_GET['upgrade'])) { if (lower_version($_GET['upgrade'], '0.1')) { try { $_pdo->query("ALTER TABLE `".constants::db_prefix."assignment` CHANGE `hours` `hours` FLOAT UNSIGNED NOT NULL"); } catch (PDOException $e) { echo "Altering the database structure failed with a PDOException ({$e->getCode()}): {$e->getMessage()}
" . $e->getTraceAsString(); } } if (lower_version($_GET['upgrade'], '0.2.2')) { try { $_pdo->query("ALTER TABLE `".constants::db_prefix."assignment` DROP FOREIGN KEY `assignment_ibfk_1`"); $_pdo->query("ALTER TABLE `".constants::db_prefix."assignment` ADD CONSTRAINT `assignment_ibfk_1` FOREIGN KEY (`offerId`) REFERENCES `".constants::db_prefix."offer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE"); } catch (PDOException $e) { echo "Altering the database structure failed with a PDOException ({$e->getCode()}): {$e->getMessage()}
" . $e->getTraceAsString(); } } echo "
All done."; } ?>

You're going to upgrade to version . What was your old version number?