|
| 1 | +<?php namespace Database\Migrations; |
| 2 | +/** |
| 3 | + * Copyright 2025 OpenStack Foundation |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * Unless required by applicable law or agreed to in writing, software |
| 9 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | + * See the License for the specific language governing permissions and |
| 12 | + * limitations under the License. |
| 13 | + **/ |
| 14 | + |
| 15 | +use Doctrine\Migrations\AbstractMigration; |
| 16 | +use Doctrine\DBAL\Schema\Schema as Schema; |
| 17 | +use LaravelDoctrine\ORM\Facades\EntityManager; |
| 18 | +use Models\OAuth2\ResourceServer; |
| 19 | +use Models\OAuth2\Api; |
| 20 | +use Database\Seeders\SeedUtils; |
| 21 | +use App\libs\OAuth2\IUserScopes; |
| 22 | +/** |
| 23 | + * Class Version20250127144553 |
| 24 | + * @package Database\Migrations |
| 25 | + */ |
| 26 | +final class Version20250127144553 extends AbstractMigration |
| 27 | +{ |
| 28 | + /** |
| 29 | + * @param Schema $schema |
| 30 | + */ |
| 31 | + public function up(Schema $schema): void |
| 32 | + { |
| 33 | + SeedUtils::seedApiEndpoints('users', [ |
| 34 | + [ |
| 35 | + 'name' => 'create-user', |
| 36 | + 'active' => true, |
| 37 | + 'route' => '/api/v1/users', |
| 38 | + 'http_method' => 'POST', |
| 39 | + 'scopes' => [ |
| 40 | + IUserScopes::Write |
| 41 | + ], |
| 42 | + ], |
| 43 | + ] |
| 44 | + ); |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * @param Schema $schema |
| 49 | + */ |
| 50 | + public function down(Schema $schema): void |
| 51 | + { |
| 52 | + |
| 53 | + } |
| 54 | +} |
0 commit comments