-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathschema.php
More file actions
248 lines (236 loc) · 15.4 KB
/
schema.php
File metadata and controls
248 lines (236 loc) · 15.4 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<?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\Topics\Config\Schema
* @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.TooManyFields)
*/
class TopicsSchema 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()) {
}
/**
* topic_frame_settings table
*
* @var array
*/
public $topic_frame_settings = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'display_type' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 4, 'unsigned' => false, 'comment' => '表示タイプ 0: フラット, 1: プラグインごとに表示, 2: ルームごとに表示'),
'unit_type' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'comment' => '表示数 (n days / n counts)'),
'display_days' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 3, 'unsigned' => false),
'display_number' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 3, 'unsigned' => false),
'display_title' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_thumbnail' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_summary' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_room_name' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_category_name' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_plugin_name' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_created_user' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'display_created' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'use_rss_feed' => array('type' => 'boolean', 'null' => false, 'default' => null),
'select_room' => array('type' => 'boolean', 'null' => false, 'default' => null),
'select_block' => array('type' => 'boolean', 'null' => false, 'default' => null),
'select_plugin' => array('type' => 'boolean', 'null' => false, 'default' => null),
'show_my_room' => array('type' => 'boolean', 'null' => false, 'default' => null),
'feed_title' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'RSSのタイトル', 'charset' => 'utf8'),
'feed_summary' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'RSSの概要', 'charset' => 'utf8'),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'frame_key' => array('column' => 'frame_key', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* topic_frames_blocks table
*
* @var array
*/
public $topic_frames_blocks = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'room_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'plugin_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'block_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'frame_key' => array('column' => 'frame_key', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* topic_frames_plugins table
*
* @var array
*/
public $topic_frames_plugins = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'plugin_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'frame_key' => array('column' => 'frame_key', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* topic_frames_rooms table
*
* @var array
*/
public $topic_frames_rooms = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'room_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'frame_key' => array('column' => 'frame_key', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* topic_readables table
* 新着に表示させる会員のリスト
*
* @var array
*/
public $topic_readables = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'topic_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'index'),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'comment' => '会員に結びつかない新着でも0として登録'),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'whatsnew' => array('column' => array('topic_id', 'user_id'), 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* topic_user_statuses table
* 新着に表示させない(既読)会員のリスト
*
* @var array
*/
public $topic_user_statuses = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'),
'topic_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'index'),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'read' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '閲覧したかどうか'),
'answered' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '回答したかどうか'),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'whatsnew' => array('column' => array('topic_id', 'user_id'), 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
/**
* topics table
*
* @var array
*/
public $topics = 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),
'room_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'index'),
'block_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'frame_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'content_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'content_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'category_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'plugin_key' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'title' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'title_icon' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'thumbnail_path' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'summary' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'search_contents' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8', 'comment' => '検索対象のシリアライズデータ'),
'counts' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false),
'path' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'public_type' => array('type' => 'integer', 'null' => false, 'default' => '1', 'length' => 4, 'unsigned' => false),
'publish_start' => array('type' => 'datetime', 'null' => true, 'default' => null, 'key' => 'index'),
'publish_end' => array('type' => 'datetime', 'null' => true, 'default' => null),
'is_no_member_allow' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'comment' => '非会員を受け付けるかどうか'),
'is_answer' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '回答かどうか'),
'is_in_room' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'comment' => 'ルーム内で完結するかどうか。カレンダーのプライベートの予定を共有するときは、0にする'),
'answer_period_start' => array('type' => 'datetime', 'null' => true, 'default' => null),
'answer_period_end' => array('type' => 'datetime', 'null' => true, 'default' => null),
'is_active' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '公開中データか否か'),
'is_latest' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => '最新編集データであるか否か'),
'status' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 4, 'unsigned' => false),
'is_origin' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'is_translation' => array('type' => 'boolean', 'null' => false, 'default' => '0'),
'is_original_copy' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => 'オリジナルのコピー。言語を新たに追加したときに使用する'),
'created_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
'modified_user' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false),
'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'plugin_key' => array('column' => array('plugin_key', 'language_id', 'content_key'), 'unique' => 0),
'whatsnew_plugin' => array('column' => array('plugin_key', 'room_id', 'publish_start', 'id', 'language_id', 'public_type', 'modified', 'publish_end', 'is_active', 'is_latest', 'status', 'created_user', 'modified_user'), 'unique' => 0),
'whatsnew' => array('column' => array('publish_start', 'id', 'language_id', 'public_type', 'modified', 'publish_end', 'room_id', 'is_active', 'is_latest', 'status', 'created_user', 'modified_user'), 'unique' => 0),
'plugin_key2' => array('column' => array('plugin_key', 'language_id', 'block_id', 'content_id'), 'unique' => 0),
'room_id' => array('column' => 'room_id', 'unique' => 0),
'search' => array('column' => array('search_contents'), 'type' => 'fulltext'),
'idx1_p_topics' => array('column' => array('category_id'), 'unique' => 0),
'idx2_p_topics' => array('column' => array('frame_id'), 'unique' => 0),
'idx3_p_topics' => array('column' => array('language_id', 'room_id', 'is_latest', 'is_active', 'is_in_room', 'created_user', 'public_type', 'publish_start', 'publish_end'), 'unique' => 0),
'idx4_p_topics' => array('column' => array('is_active', 'room_id', 'public_type', 'publish_start', 'publish_end', 'created_user', 'id', '`plugin_key`(191)'), 'unique' => 0),
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'Mroonga', 'comment' => 'engine "InnoDB"')
);
}