Zeiterfassung update

This commit is contained in:
Spitzer Daniel
2024-02-04 11:49:57 +01:00
parent eb20fd935e
commit e57889ee6c
18 changed files with 1148 additions and 331 deletions
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingEmployeeAddFields extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingEmployee", ["signed" => true]);
$table->addColumn("holidays_now", "integer", ["null" => false, "after" => "holidays"]);
$table->addColumn("startdate", "integer", ["null" => false, "after" => "plushours"]);
$table->addColumn("plushours_now", "integer", ["null" => false, "after" => "plushours"]);
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("WorkerPermission")->removeColumn("startdate")->save();
$this->table("WorkerPermission")->removeColumn("plushours_now")->save();
$this->table("WorkerPermission")->removeColumn("holidays_now")->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingRenameField extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Timerecording");
$table->renameColumn('commend', 'comment')
->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Timerecording");
$table->renameColumn('comment', 'commend')
->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}