Completed
Push — master ( 0cc858...872c3d )
by vistart
05:22
created

down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.me/
9
 * @copyright Copyright (c) 2016 - 2017 vistart
10
 * @license https://vistart.me/license/
11
 */
12
13
namespace rhosocial\organization\migrations;
14
15
use rhosocial\organization\Organization;
16
use rhosocial\user\migrations\Migration;
17
18
/**
19
 * Class m170416_065915_AddMemberJoinInRestrictionColumns
20
 */
21
class m170416_065915_AddMemberJoinInRestrictionColumns extends Migration
22
{
23
    public function up()
24
    {
25
        if ($this->db->driverName == 'mysql') {
26
            $this->addColumn(Organization::tableName(), 'eom',
27
                $this->boolean()->notNull()->defaultValue(false)->comment("Exclude Other Members"));
28
            $this->addColumn(Organization::tableName(), 'djo',
29
                $this->boolean()->notNull()->defaultValue(false)->comment("Disallow Member to Join Other Org"));
30
            $this->addColumn(Organization::tableName(), 'oacm',
31
                $this->boolean()->notNull()->defaultValue(false)->comment("Only Accept Current Org Member"));
32
            $this->addColumn(Organization::tableName(), 'oasm',
33
                $this->boolean()->notNull()->defaultValue(false)->comment("Only Accept Superior Org Member"));
34
        }
35
    }
36
37
    public function down()
38
    {
39
        $this->dropColumn(Organization::tableName(), 'eom');
40
        $this->dropColumn(Organization::tableName(), 'djo');
41
        $this->dropColumn(Organization::tableName(), 'oacm');
42
        $this->dropColumn(Organization::tableName(), 'oasm');
43
    }
44
45
    /*
46
    // Use safeUp/safeDown to run migration code within a transaction
47
    public function safeUp()
48
    {
49
    }
50
51
    public function safeDown()
52
    {
53
    }
54
    */
55
}
56