27 lines
841 B
PHP
27 lines
841 B
PHP
<?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();
|
|
}
|
|
}
|