Fixed some migrations
This commit is contained in:
@@ -22,6 +22,7 @@ final class ConstructionConsentChangeStatusAndResult extends AbstractMigration
|
|||||||
$cco = $this->table("ConstructionConsentOwner");
|
$cco = $this->table("ConstructionConsentOwner");
|
||||||
$cco->changeColumn("status", "enum", ["null" => true, "default" => null, "values" => "new,requested,answered"]);
|
$cco->changeColumn("status", "enum", ["null" => true, "default" => null, "values" => "new,requested,answered"]);
|
||||||
$cco->changeColumn("result", "enum", ["null" => true, "default" => null, "values" => "success,failure"]);
|
$cco->changeColumn("result", "enum", ["null" => true, "default" => null, "values" => "success,failure"]);
|
||||||
|
$cco->update();
|
||||||
|
|
||||||
$this->execute("UPDATE ConstructionConsentOwner SET status=NULL, result=NULL");
|
$this->execute("UPDATE ConstructionConsentOwner SET status=NULL, result=NULL");
|
||||||
$cco->changeColumn("status", "enum", ["null" => true, "default" => null, "values" => "new,sent,returned,outstanding"]);
|
$cco->changeColumn("status", "enum", ["null" => true, "default" => null, "values" => "new,sent,returned,outstanding"]);
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ use Phinx\Migration\AbstractMigration;
|
|||||||
final class WarehouseModify10 extends AbstractMigration {
|
final class WarehouseModify10 extends AbstractMigration {
|
||||||
public function up(): void {
|
public function up(): void {
|
||||||
if ($this->getEnvironment() == "thetool") {
|
if ($this->getEnvironment() == "thetool") {
|
||||||
// Drop the existing tables
|
// Remove foreign keys and drop the existing tables
|
||||||
|
$this->table("WarehouseOrderItem")
|
||||||
|
->dropForeignKey("orderId")
|
||||||
|
->dropForeignKey("articleId")
|
||||||
|
->update();
|
||||||
|
|
||||||
$this->table("WarehouseOrder")->drop()->save();
|
$this->table("WarehouseOrder")->drop()->save();
|
||||||
$this->table("WarehouseOrderItem")->drop()->save();
|
$this->table("WarehouseOrderItem")->drop()->save();
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ final class WarehouseOfferVersioning extends AbstractMigration
|
|||||||
// Use Phinx schema builder to add columns to the WarehouseOffer table
|
// Use Phinx schema builder to add columns to the WarehouseOffer table
|
||||||
$warehouseOffer = $this->table('WarehouseOffer');
|
$warehouseOffer = $this->table('WarehouseOffer');
|
||||||
$warehouseOffer
|
$warehouseOffer
|
||||||
|
->addColumn('contactPerson', 'string', ['limit' => 255, 'null' => true, "after" => 'customerName'])
|
||||||
->addColumn('contactPersonEmail', 'string', ['limit' => 255, 'null' => true, 'after' => 'contactPerson'])
|
->addColumn('contactPersonEmail', 'string', ['limit' => 255, 'null' => true, 'after' => 'contactPerson'])
|
||||||
->addColumn('lastSentDate', 'integer', ['null' => true, 'after' => 'status'])
|
->addColumn('lastSentDate', 'integer', ['null' => true, 'after' => 'status'])
|
||||||
->addColumn('version', 'integer', ['default' => 1, 'after' => 'id'])
|
->addColumn('version', 'integer', ['default' => 1, 'after' => 'id'])
|
||||||
|
|||||||
Reference in New Issue
Block a user