added categories to assetmanagement

This commit is contained in:
Luca Haid
2026-01-19 06:51:56 +01:00
parent 15afb237e1
commit bd0a332aa1
4 changed files with 91 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AssetManagementAddCategory extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("AssetManagement");
$table->addColumn('category', 'string', [
'limit' => 255,
'null' => true,
'default' => null,
'after' => 'description',
'comment' => 'Free text category for the asset with autocomplete support',
]);
$table->addIndex(['category'], ['name' => 'idx_category']);
$table->update();
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("AssetManagement");
$table->removeIndex(['category']);
$table->removeColumn('category');
$table->update();
}
}
}