Files
thetool/db/migrations/20250306134255_create_sbidi_order.php
2025-03-11 14:04:50 +01:00

53 lines
2.2 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateSbidiOrder extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("SbidiOrder");
$table->addColumn("name", "string", ["limit" => 64, "null" => true]);
$table->addColumn("building_rimo_id", "string", ["limit" => 64, "null" => true]);
$table->addColumn("home_rimo_id", "string", ["limit" => 64, "null" => true]);
$table->addColumn("workorder_rimo_id", "string", ["limit" => 64, "null" => true]);
$table->addColumn("order_date", "datetime", ["null" => true]);
$table->addColumn("building_type", "string", ["limit" => 64, "null" => true]); // SD/MD
$table->addColumn("uid", "string", ["limit" => 64, "null" => true]);
$table->addColumn("firstname", "string", ["limit" => 255, "null" => true]);
$table->addColumn("lastname", "string", ["limit" => 255, "null" => true]);
$table->addColumn("phone", "string", ["limit" => 255, "null" => true]);
$table->addColumn("address", "string", ["limit" => 255, "null" => true]);
$table->addColumn("zip", "string", ["limit" => 255, "null" => true]);
$table->addColumn("city", "string", ["limit" => 255, "null" => true]);
$table->addColumn("country", "string", ["limit" => 255, "null" => true]);
$table->addColumn("email", "string", ["limit" => 255, "null" => true]);
$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->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("SbidiOrder")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}