Merge branch 'spidev' into 'master'

Zeiterfassungs Update

See merge request fronk/thetool!303
This commit is contained in:
Frank Schubert
2024-03-28 15:20:54 +00:00
26 changed files with 1891 additions and 43 deletions
@@ -0,0 +1,40 @@
<?php
use Phinx\Migration\AbstractMigration;
final class TimerecordingCar extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingCar", ["signed" => true]);
$table->addColumn("number_plate", "string", ["null" => false]);
$table->addColumn("brand", "text", ["null" => true]);
$table->addColumn("model", "text", ["null" => true]);
$table->addColumn("mileage", "integer", ["null" => true]);
$table->addColumn("mileage_now", "integer", ["null" => true]);
$table->addColumn("mileage_timestamp", "integer", ["null" => true]);
$table->addColumn("initial_approval", "integer", ["null" => true]);
$table->addColumn("timerecording", "integer", ["default" => 1]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("TimerecordingCar")->drop()->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingAddFieldsCar extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("Timerecording", ["signed" => true]);
$table->addColumn("timerecordingCar_id", "integer", ["null" => true, "default" => NULL, "after" => "businesstrip_info"]);
$table->addColumn("mileage_start", "integer", ["null" => true, "default" => NULL, "after" => "timerecordingCar"]);
$table->addColumn("mileage_end", "integer", ["null" => true, "default" => NULL, "after" => "mileage_start"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("Timerecording")->removeColumn("timerecordingCar")->save();
$this->table("Timerecording")->removeColumn("mileage_start")->save();
$this->table("Timerecording")->removeColumn("mileage_end")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingCategoryAddFieldUnpaid extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingCategory", ["signed" => true]);
$table->addColumn("unpaid", "integer", ["null" => false, "default" => '0', "after" => "businesstrip"]);
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("TimerecordingCategory")->removeColumn("unpaid")->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}