35 lines
851 B
PHP
35 lines
851 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AddDescriptionToAssetManagement extends AbstractMigration
|
|
{
|
|
/**
|
|
* Adds the 'description' column to the 'AssetManagement' table.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table('AssetManagement');
|
|
$table->addColumn('description', 'text', [
|
|
'null' => true,
|
|
'after' => 'name',
|
|
]);
|
|
$table->update();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Removes the 'description' column from the 'AssetManagement' table.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$table = $this->table('AssetManagement');
|
|
$table->removeColumn('description');
|
|
$table->update();
|
|
}
|
|
}
|
|
}
|