Workorder mph/improve
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddWorkorderMphPermissions extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WorkerPermission");
|
||||
$table->addColumn("canWorkorderMphAdmin", "enum", ["values" => 'false,true', "default" => "false", "after" => "canRMLAdmin"]);
|
||||
$table->addColumn("canWorkorderMph", "enum", ["values" => 'false,true', "default" => "false", "after" => "canWorkorderMphAdmin"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("WorkerPermission")->removeColumn("canWorkorderMphAdmin")->save();
|
||||
$this->table("WorkerPermission")->removeColumn("canWorkorderMph")->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddWorkorderTenantConfigModuleFlags extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table('WorkorderTenantConfig');
|
||||
|
||||
$table->addColumn('enableWorkorder', 'boolean', [
|
||||
'default' => true,
|
||||
'null' => false,
|
||||
'after' => 'requireCableType',
|
||||
'comment' => 'Enable Workorder module for this tenant'
|
||||
]);
|
||||
|
||||
$table->addColumn('enableWorkorderMph', 'boolean', [
|
||||
'default' => true,
|
||||
'null' => false,
|
||||
'after' => 'enableWorkorder',
|
||||
'comment' => 'Enable WorkorderMPH module for this tenant'
|
||||
]);
|
||||
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table('WorkorderTenantConfig')
|
||||
->removeColumn('enableWorkorder')
|
||||
->removeColumn('enableWorkorderMph')
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user