fixed nuovo
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddCategoryToPauseReasons extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('pause_reasons')
|
||||
->addColumn('category', 'enum', [
|
||||
'values' => ['planned', 'unplanned'],
|
||||
'null' => false,
|
||||
'default' => 'unplanned',
|
||||
'after' => 'is_problem',
|
||||
'comment' => 'planned = fermo pianificato (cambio, pulizia, mensa); unplanned = guasto, mancanza materiale, qualità',
|
||||
])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddDailyCapacityToProductionLines extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('production_lines')
|
||||
->addColumn('max_hours_per_day', 'decimal', [
|
||||
'precision' => 4,
|
||||
'scale' => 2,
|
||||
'null' => false,
|
||||
'default' => 24.00,
|
||||
'after' => 'color',
|
||||
'comment' => 'Ore massime di disponibilita giornaliera della linea (default 24)',
|
||||
])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddPreferredLineToAuthUsers extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('auth_users')
|
||||
->addColumn('preferred_line_id', 'integer', [
|
||||
'signed' => true, // production_lines.id è int(11) SIGNED → deve combaciare
|
||||
'limit' => 11,
|
||||
'null' => true,
|
||||
'default' => null,
|
||||
'after' => 'notify_webapp',
|
||||
'comment' => 'Linea di produzione preferita per la Line View (NULL = Tutte)',
|
||||
])
|
||||
->addForeignKey('preferred_line_id', 'production_lines', 'id', [
|
||||
'delete' => 'SET_NULL',
|
||||
'update' => 'NO_ACTION',
|
||||
])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user