20260428120001_create_oidc_role_mappings.php 621 B

12345678910111213141516171819202122
  1. <?php
  2. declare(strict_types=1);
  3. use App\Infrastructure\Db\Migrations\BaseMigration;
  4. final class CreateOidcRoleMappings extends BaseMigration
  5. {
  6. public function change(): void
  7. {
  8. $table = $this->table('oidc_role_mappings');
  9. $table
  10. ->addColumn('group_id', 'string', ['limit' => 128, 'null' => false])
  11. ->addColumn('role', 'string', ['limit' => 32, 'null' => false]);
  12. $this->addTimestampColumn($table, 'created_at');
  13. $table
  14. ->addIndex(['group_id'], ['unique' => true, 'name' => 'uniq_oidc_role_mappings_group_id'])
  15. ->create();
  16. }
  17. }