39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class PreorderHistoryAddChanged extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table('PreorderHistory');
|
|
$table->addColumn('changed', 'integer', ["null" => true, "after" => "new_value"]);
|
|
$table->update();
|
|
|
|
$builder = $this->getQueryBuilder();
|
|
$q = $builder->select("*")->from("PreorderHistory")->execute();
|
|
|
|
$this->query("UPDATE PreorderHistory SET `changed` = `create`");
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table('PreorderHistory');
|
|
$table->removeColumn('changed');
|
|
$table->update();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|