added functions email and flag
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user