Files
thetool/db/migrations/20240317165103_timerecording_car.php
Spitzer Daniel 025522a740 Zeiterfassungs Update
* Implementerung Fahrzeugverwaltung
 * neue Buchungsart Fahrtenbuch
 * Diverse Bugfixes
2024-03-26 08:08:01 +01:00

40 lines
1.5 KiB
PHP

<?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") {
}
}
}
?>