-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.php
More file actions
100 lines (93 loc) · 4.68 KB
/
schema.php
File metadata and controls
100 lines (93 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/**
* Schema file
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
/**
* Schema file
*
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @package NetCommons\Roles\Config\Schema
* @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.TooManyFields)
*/
class RolesSchema extends CakeSchema {
/**
* Database connection
*
* @var string
*/
public $connection = 'master';
/**
* before
*
* @param array $event event
* @return bool
*/
public function before($event = array()) {
return true;
}
/**
* after
*
* @param array $event event
* @return void
*/
public function after($event = array()) {
}
/**
* default_role_permissions table
*
* @var array
*/
public $default_role_permissions = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'role_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'type' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'ロールタイプ e.g.) room_role, announcement_block_role, bbs_block_role', 'charset' => 'utf8'),
'permission' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'パーミッション名 e.g.) page_creatable, content_editable', 'charset' => 'utf8'),
'value' => array('type' => 'boolean', 'null' => false, 'default' => null),
'fixed' => array('type' => 'boolean', 'null' => false, 'default' => null),
'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'role_key' => array('column' => 'role_key', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* roles table
*
* @var array
*/
public $roles = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'language_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 6, 'unsigned' => false, 'key' => 'index'),
'is_origin' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'comment' => 'オリジナルかどうか'),
'is_translation' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '翻訳したかどうか'),
'is_original_copy' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => 'オリジナルのコピー。言語を新たに追加したときに使用する'),
'key' => array('type' => 'string', 'null' => true, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'comment' => 'ロールKey', 'charset' => 'utf8'),
'type' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'index', 'comment' => 'ロールタイプ 1: User role, 2: Room role'),
'name' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'ロール名', 'charset' => 'utf8'),
'description' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'is_system' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '1:システムのロール, 0:権限管理で追加したロール'),
'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'type' => array('column' => array('type', 'language_id'), 'unique' => 0),
'key' => array('column' => array('key', 'language_id'), 'unique' => 0),
'role_id' => array('column' => array('language_id', 'id'), 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
}