added error page and logs linked
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddLogFileToDatadb extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$table = $this->table('datadb');
|
||||
if (!$table->hasColumn('log_file')) {
|
||||
$table->addColumn('log_file', 'string', [
|
||||
'limit' => 255,
|
||||
'null' => true,
|
||||
'default' => null,
|
||||
'after' => 'commessaweb', // aggiusta se la colonna non esiste
|
||||
])->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddErrorStatusToDatadb extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// Aggiunge 'x' (errore export) all'enum status, preservando i valori esistenti
|
||||
$this->execute("ALTER TABLE `datadb`
|
||||
MODIFY `status` ENUM('i','P','l','x') NULL DEFAULT NULL");
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// Rollback: riporta le eventuali 'x' a NULL prima di togliere il valore
|
||||
$this->execute("UPDATE `datadb` SET `status` = NULL WHERE `status` = 'x'");
|
||||
$this->execute("ALTER TABLE `datadb`
|
||||
MODIFY `status` ENUM('i','P','l') NULL DEFAULT NULL");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user