addSql("ALTER TABLE oauth2_client ADD required_roles JSON DEFAULT NULL COMMENT '(DC2Type:json)'"); $this->addSql("UPDATE oauth2_client SET required_roles = '[]'"); $this->addSql("ALTER TABLE oauth2_client MODIFY required_roles JSON NOT NULL COMMENT '(DC2Type:json)'"); // mirrors ephub's App\Security\Role::ELIGIBLE $this->addSql('UPDATE oauth2_client SET required_roles = :roles WHERE name = :name', [ 'roles' => json_encode(['ROLE_EMPLOYEE', 'ROLE_ADMIN'], JSON_THROW_ON_ERROR), 'name' => 'EPHub', ]); // mirrors myep-team's App\Security\MyEpAuthenticator::ELIGIBLE_ROLES $this->addSql('UPDATE oauth2_client SET required_roles = :roles WHERE name = :name', [ 'roles' => json_encode(['ROLE_TEAM_ADMIN', 'ROLE_TEAMER', 'ROLE_MANAGER', 'ROLE_HOUSE_MANAGER'], JSON_THROW_ON_ERROR), 'name' => 'MyEPTeam', ]); } public function down(Schema $schema): void { $this->addSql('ALTER TABLE oauth2_client DROP required_roles'); } }