Passed
Push — develop ( f56b47...da1be7 )
by nguereza
02:00
created

AddOauth2ScopesTable20230802144938::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 20
rs 9.8666
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Platine\Framework\Migration;
6
7
use Platine\Database\Schema\CreateTable;
0 ignored issues
show
Bug introduced by
The type Platine\Database\Schema\CreateTable was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Platine\Framework\Migration\AbstractMigration;
0 ignored issues
show
Bug introduced by
The type Platine\Framework\Migration\AbstractMigration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class AddOauth2ScopesTable20230802144938 extends AbstractMigration
11
{
12
    public function up(): void
13
    {
14
      //Action when migrate up
15
        $this->create('oauth_scopes', function (CreateTable $table) {
16
            $table->integer('id')
17
                  ->autoincrement()
18
                 ->primary();
19
20
            $table->string('name')
21
                 ->notNull();
22
23
            $table->string('description');
24
25
            $table->boolean('is_default')
26
                 ->description('Whether is the default scope')
27
                 ->notNull();
28
29
            $table->timestamps();
30
31
            $table->engine('INNODB');
32
        });
33
    }
34
35
    public function down(): void
36
    {
37
      //Action when migrate down
38
        $this->drop('oauth_scopes');
39
    }
40
}
41