Feature/preorder add history
This commit is contained in:
committed by
Frank Schubert
parent
076b513039
commit
04153eb8d3
@@ -0,0 +1,32 @@
|
||||
<?php /** @noinspection ALL */
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddPreorderHistory extends AbstractMigration {
|
||||
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
|
||||
$preorderHistoryTable = $this->table("PreorderHistory", ["signed" => true]);
|
||||
$preorderHistoryTable
|
||||
->addColumn("preorder_id", "integer", ["null" => false, "signed" => true])
|
||||
->addColumn("key", "string", ["null" => false, "limit" => 100])
|
||||
->addColumn("old_value", "text", ["null" => true])
|
||||
->addColumn("new_value", "text", ["null" => true])
|
||||
->addColumn("create_by", "integer", ["null" => false])
|
||||
->addColumn("edit_by", "integer", ["null" => false])
|
||||
->addColumn("create", "integer", ["null" => false])
|
||||
->addColumn("edit", "integer", ["null" => false]);
|
||||
|
||||
$preorderHistoryTable->addForeignKey("preorder_id", "Preorder", "id", ["delete" => "CASCADE", "update" => "NO_ACTION"]);
|
||||
$preorderHistoryTable->create();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table("PreorderHistory")->drop()->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user