Completed
Push — master ( 4084ed...cda37d )
by Anton
13s
created

ModuleTestPermissions::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @copyright Bluz PHP Team
4
 * @link https://github.com/bluzphp/skeleton
5
 */
6
7
use Phinx\Migration\AbstractMigration;
8
9
/**
10
 * CreateTestTable
11
 */
12
class ModuleTestPermissions extends AbstractMigration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
13
{
14
    /**
15
     * Migrate Up.
16
     */
17
    public function up()
18
    {
19
        $data = [
20
            [
21
                'roleId' => 2,
22
                'module' => 'test',
23
                'privilege' => 'Create'
24
            ],
25
            [
26
                'roleId' => 2,
27
                'module' => 'test',
28
                'privilege' => 'Read'
29
            ],
30
            [
31
                'roleId' => 2,
32
                'module' => 'test',
33
                'privilege' => 'Update'
34
            ],
35
            [
36
                'roleId' => 2,
37
                'module' => 'test',
38
                'privilege' => 'Delete'
39
            ],
40
        ];
41
42
        $privileges = $this->table('acl_privileges');
43
        $privileges->insert($data)
44
            ->save();
45
    }
46
47
    /**
48
     * Migrate Down.
49
     */
50
    public function down()
51
    {
52
        $this->execute('DELETE FROM acl_privileges WHERE module = "test"');
53
    }
54
}
55