Files
CakePHP_Repozytorium/config/Migrations/20251127104753_Tools.php
Patryk_Turbakiewicz ab9076a87b
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
Initial commit for main repository
2025-11-28 14:33:55 +01:00

25 lines
673 B
PHP

<?php
declare(strict_types=1);
use Migrations\BaseMigration;
class Tools extends BaseMigration
{
public function change(): void
{
$table = $this->table('tools')
->addColumn('name', 'string', ['limit' => 150])
->addColumn('description', 'text', ['null' => true])
->addColumn('quantity', 'integer', ['default' => 1])
->addColumn('active', 'boolean', ['default' => true])
->addColumn('created', 'datetime')
->addColumn('modified', 'datetime', ['null' => true])
->create();
}
public function down(): void
{
$this->table('tools')->drop()->save();
}
}