Merge branch 'master' into fronkdev
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class WarehouseModify10 extends AbstractMigration {
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
// Drop the existing tables
|
||||
$this->table("WarehouseOrder")->drop()->save();
|
||||
$this->table("WarehouseOrderItem")->drop()->save();
|
||||
|
||||
// Create the new WarehouseOrder table
|
||||
$table = $this->table("WarehouseOrder", ["id" => false, "primary_key" => ["id"]]);
|
||||
$table->addColumn("id", "integer", ["identity" => true])
|
||||
->addColumn("orderNumber", "string", ["null" => false, "limit" => 255])
|
||||
->addColumn("delAddrCity", "string", ["null" => false, "limit" => 255])
|
||||
->addColumn("delAddrEMail", "string", ["null" => false, "limit" => 255])
|
||||
->addColumn("delAddrLine", "string", ["null" => false, "limit" => 255])
|
||||
->addColumn("delAddrName", "string", ["null" => false, "limit" => 255])
|
||||
->addColumn("delAddrPLZ", "string", ["null" => false, "limit" => 255])
|
||||
->addColumn("editor", "integer", ["null" => false])
|
||||
->addColumn("note", "text", ["null" => false])
|
||||
->addColumn("positions", "text", ["null" => false])
|
||||
->addColumn("create", "integer", ["null" => false])
|
||||
->addColumn("createBy", "integer", ["null" => false])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table("WarehouseOrder")->drop()->save();
|
||||
|
||||
$WarehouseOrder = $this->table("WarehouseOrder", ["signed" => true]);
|
||||
$WarehouseOrder
|
||||
->addColumn('distributorId', 'integer', ['null' => false])
|
||||
->addColumn('intRef', 'string', ['null' => true])
|
||||
->addColumn('extRef', 'string', ['null' => true])
|
||||
->addColumn('status', 'enum', ['values' => ['new', 'accepted', 'sent', 'done'], 'null' => false, 'default' => 'new'])
|
||||
->addColumn('sum', 'float', ['null' => true])
|
||||
->addColumn('trackingNumber', 'string', ['null' => true])
|
||||
->addColumn('create', 'integer', ['null' => false, 'default' => 1728541890])
|
||||
->addColumn('createBy', 'integer', ['null' => false, 'default' => 1])
|
||||
->create();
|
||||
|
||||
$WarehouseOrderItem = $this->table("WarehouseOrderItem", ["signed" => true]);
|
||||
$WarehouseOrderItem
|
||||
->addColumn('orderId', 'integer', ['null' => false])
|
||||
->addColumn('articleId', 'integer', ['null' => false])
|
||||
->addColumn('quantity', 'integer', ['null' => false])
|
||||
->addColumn('price', 'float', ['null' => false])
|
||||
->addForeignKey('orderId', 'WarehouseOrder', 'id')
|
||||
->addForeignKey('articleId', 'WarehouseArticle', 'id')
|
||||
->create();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class WarehouseModify11 extends AbstractMigration {
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WarehouseOrder");
|
||||
$table->addColumn("distributorId", "integer", ["null" => false]);
|
||||
$table->save();;
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WarehouseOrder");
|
||||
$table->removeColumn("distributorId");
|
||||
$table->save();;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class WarehouseModify12 extends AbstractMigration {
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WarehouseOrder");
|
||||
$table->addColumn("extReference", "string", ["length" => 255, "null" => true]);
|
||||
$table->save();;
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WarehouseOrder");
|
||||
$table->removeColumn("extReference");
|
||||
$table->save();;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class TimerecordingEmployeeWorkingHourHistory extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("TimerecordingEmployeeWorkingHourHistory", ["signed" => true]);
|
||||
$table->addColumn("user_id", "integer", ["null" => false]);
|
||||
$table->addColumn("enddate", "integer", ["null" => false, "limit" => 64]);
|
||||
$table->addColumn("workinghours", "string", ["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->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("TimerecordingEmployeeWorkingHourHistory")->drop()->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user