Correzione minore su namespace in aggiornamento

This commit is contained in:
Dasc3er 2020-09-24 11:15:18 +02:00
parent f4c0909425
commit 542f3035a2
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,8 @@
* Creazione dei campi per l'API (created_at e updated_at)
*/
use API\Response;
// I record precedenti vengono impostati a NULL
$tables = include __DIR__.'/tables.php';
@ -16,7 +18,7 @@ foreach ($tables as $table) {
$database->query('ALTER TABLE `'.$table.'` ADD `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP');
}
if (API\Response::isCompatible()) {
if (Response::isCompatible()) {
$updated_at = $database->fetchArray(str_replace('|field|', 'updated_at', $query));
if (empty($updated_at)) {
$database->query('ALTER TABLE `'.$table.'` ADD `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP');