added functions email and flag

This commit is contained in:
2026-06-11 10:20:46 +02:00
parent 33b627f328
commit fdde16b113
5 changed files with 213 additions and 25 deletions
@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddNotifyFunctionToScadDeadlines extends AbstractMigration
{
public function up(): void
{
if (!$this->hasTable('scad_deadlines')) {
throw new RuntimeException('Table scad_deadlines does not exist.');
}
$table = $this->table('scad_deadlines');
if (!$table->hasColumn('notify_function')) {
$table
->addColumn('notify_function', 'boolean', [
'null' => false,
'default' => false,
'after' => 'function_id',
'comment' => 'Send deadline reminder also to the linked function email',
])
->update();
}
}
public function down(): void
{
if (!$this->hasTable('scad_deadlines')) {
return;
}
$table = $this->table('scad_deadlines');
if ($table->hasColumn('notify_function')) {
$table
->removeColumn('notify_function')
->update();
}
}
}