20260428120003_create_policies.php 668 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. use App\Infrastructure\Db\Migrations\BaseMigration;
  4. final class CreatePolicies extends BaseMigration
  5. {
  6. public function change(): void
  7. {
  8. $table = $this->table('policies');
  9. $table
  10. ->addColumn('name', 'string', ['limit' => 128, 'null' => false])
  11. ->addColumn('description', 'text', ['null' => true])
  12. ->addColumn('include_manual_blocks', 'boolean', ['null' => false, 'default' => true]);
  13. $this->addTimestampColumn($table, 'created_at');
  14. $table
  15. ->addIndex(['name'], ['unique' => true, 'name' => 'uniq_policies_name'])
  16. ->create();
  17. }
  18. }