WIP new preorder stati
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class PreorderstatusAddConnectiontype extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Preorderstatus");
|
||||
$table->addColumn("connection_type", "enum", ["null" => false, "values" => "all,single,multi", "default" => "all", "after" => "name"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Preorderstatus");
|
||||
$table->removeColumn("connection_type");
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddessdbAddStatus extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
$table = $this->table("Status");
|
||||
$table->addColumn("code", "integer", ["null" => false]);
|
||||
$table->addColumn("name", "string", ["null" => false, "limit" => 64]);
|
||||
$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();
|
||||
|
||||
$this->table("Hausnummer")->addColumn("status_id", "integer", ["null" => false, "default" => 1, "after" => "id"])->update();
|
||||
$this->table("Wohneinheit")->addColumn("status_id", "integer", ["null" => false, "default" => 1, "after" => "id"])->update();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
$this->table("Hausnummer")->removeColumn("status_id")->update();
|
||||
$this->table("Wohneinheit")->removeColumn("status_id")->update();
|
||||
$this->table("Status")->drop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user