22 lines
777 B
PHP
22 lines
777 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreateWarehouseProjectJournal extends AbstractMigration
|
|
{
|
|
public function change(): void
|
|
{
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$table = $this->table('WarehouseProjectJournal');
|
|
$table->addColumn('projectId', 'integer')
|
|
->addColumn('text', 'text', ['null' => true])
|
|
->addColumn('data', 'json', ['null' => true, 'comment' => 'Stores changes/diffs'])
|
|
->addColumn('createBy', 'integer')
|
|
->addColumn('create', 'integer')
|
|
->addForeignKey('projectId', 'WarehouseProject', 'id', ['delete' => 'CASCADE', 'update' => 'CASCADE'])
|
|
->create();
|
|
}
|
|
}
|
|
}
|