Fix database date: 0000-00-00 -> NULL

This commit is contained in:
Chocobozzz
2017-02-05 17:07:56 +01:00
parent 1aac22b46d
commit ab7f85b404
14 changed files with 125 additions and 28 deletions
+16
View File
@@ -1,5 +1,21 @@
<?php
function getMigrationSchemas() {
return [ 0, 5 ];
}
function updateSchema($bdd, $newKey) {
if ($newKey === 0) {
$req_string = 'INSERT INTO `application` (sql_schema) VALUES (?)';
}
else {
$req_string = 'UPDATE `application` SET `sql_schema` = ?';
}
$req = $bdd->prepare($req_string);
$req->execute(array($newKey));
}
function printError($str) {
echo '<div class="alert alert-danger" role="alert">' . $str . '</div>';
}