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
|
|
|
|