From 6deca4406317d6ee144e130f424a646da6c7f9f3 Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Sat, 8 Mar 2025 09:21:53 +0100 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20neues=20Feature:=20*=20Migratio?= =?UTF-8?q?ns=20f=C3=BCr=20PRjoect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...250304155250_timerecording_car_journal.php | 36 +++++++++++++++++++ ...5311_timerecording_car_mileage_history.php | 36 +++++++++++++++++++ ...ording_car_add_field_override_approval.php | 34 ++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 db/migrations/20250304155250_timerecording_car_journal.php create mode 100644 db/migrations/20250304155311_timerecording_car_mileage_history.php create mode 100644 db/migrations/20250304165221_timerecording_car_add_field_override_approval.php diff --git a/db/migrations/20250304155250_timerecording_car_journal.php b/db/migrations/20250304155250_timerecording_car_journal.php new file mode 100644 index 000000000..3e90600f9 --- /dev/null +++ b/db/migrations/20250304155250_timerecording_car_journal.php @@ -0,0 +1,36 @@ +getEnvironment() == "thetool") { + $table = $this->table("TimerecordingCarJournal", ["signed" => true]); + + $table->addColumn("TimerecordingCar_id", "integer", ["null" => true]); + $table->addColumn("journal", "text", ["null" => false]); + $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("TimerecordingCarJournal")->drop()->save(); + } + if ($this->getEnvironment() == "addressdb") { + } + } +} + +?> \ No newline at end of file diff --git a/db/migrations/20250304155311_timerecording_car_mileage_history.php b/db/migrations/20250304155311_timerecording_car_mileage_history.php new file mode 100644 index 000000000..a5eb49af5 --- /dev/null +++ b/db/migrations/20250304155311_timerecording_car_mileage_history.php @@ -0,0 +1,36 @@ +getEnvironment() == "thetool") { + $table = $this->table("TimerecordingCarMileageHistory", ["signed" => true]); + + $table->addColumn("TimerecordingCar_id", "integer", ["null" => true]); + $table->addColumn("mileage", "integer", ["null" => false]); + $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("TimerecordingCarMileageHistory")->drop()->save(); + } + if ($this->getEnvironment() == "addressdb") { + } + } +} + +?> \ No newline at end of file diff --git a/db/migrations/20250304165221_timerecording_car_add_field_override_approval.php b/db/migrations/20250304165221_timerecording_car_add_field_override_approval.php new file mode 100644 index 000000000..343195162 --- /dev/null +++ b/db/migrations/20250304165221_timerecording_car_add_field_override_approval.php @@ -0,0 +1,34 @@ +getEnvironment() == "thetool") { + $table = $this->table("TimerecordingCar", ["signed" => true]); + $table->addColumn("type", "integer", ["null" => true, "default" => 1, "after" => "user_id"]); + $table->addColumn("override_approval", "integer", ["null" => true, "default" => NULL, "after" => "initial_approval"]); + $table->addColumn("retired", "integer", ["null" => true, "default" => NULL, "after" => "timerecording"]); + $table->addColumn("retired_date", "integer", ["null" => true, "default" => NULL, "after" => "retired"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("TimerecordingCar")->removeColumn("override_approval")->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}