Merge branch 'spidev' into 'master'

Zeiterfassung Update/Bugfix/Migration

See merge request fronk/thetool!269
This commit is contained in:
Frank Schubert
2024-02-27 13:36:04 +00:00
14 changed files with 583 additions and 32 deletions
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingEmployeeAddFieldOvertime extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingEmployee", ["signed" => true]);
$table->addColumn("overtime", "integer", ["null" => false, "default" => '0', "after" => "plushours_now"]);
$table->addColumn("overtime_now", "integer", ["null" => false, "default" => '0', "after" => "plushours_now"]);
$table->addColumn("overtime_timestamp", "integer", ["null" => true, "after" => "overtime_now"]);
$table->addColumn("holidays_timestamp", "integer", ["null" => true, "after" => "holidays_now"]);
$table->addColumn("plushours_timestamp", "integer", ["null" => true, "after" => "plushours_now"]);
$table->addColumn("birthday", "integer", ["null" => true, "after" => "startdate"]);
$table->addColumn("bpahours", "integer", ["null" => false, "default" => '0', "after" => "overtime"]);
$table->changeColumn('holidays_now', 'integer', ["null" => false, "default" => '0']);
$table->changeColumn('plushours_now', 'integer', ["null" => false, "default" => '0']);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("TimerecordingEmployee")->removeColumn("overtime")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}