| @@ 138-169 (lines=32) @@ | ||
| 135 | } |
|
| 136 | ||
| 137 | ||
| 138 | if (!$schema->hasTable('circle_clouds')) { |
|
| 139 | $table = $schema->createTable('circle_clouds'); |
|
| 140 | $table->addColumn( |
|
| 141 | 'cloud_id', 'string', [ |
|
| 142 | 'notnull' => true, |
|
| 143 | 'length' => 64, |
|
| 144 | ] |
|
| 145 | ); |
|
| 146 | $table->addColumn( |
|
| 147 | 'address', 'string', [ |
|
| 148 | 'notnull' => true, |
|
| 149 | 'length' => 255, |
|
| 150 | ] |
|
| 151 | ); |
|
| 152 | $table->addColumn( |
|
| 153 | 'status', 'smallint', [ |
|
| 154 | 'notnull' => true, |
|
| 155 | 'length' => 1, |
|
| 156 | ] |
|
| 157 | ); |
|
| 158 | $table->addColumn( |
|
| 159 | 'note', 'text', [ |
|
| 160 | 'notnull' => false |
|
| 161 | ] |
|
| 162 | ); |
|
| 163 | $table->addColumn( |
|
| 164 | 'created', 'datetime', [ |
|
| 165 | 'notnull' => false, |
|
| 166 | ] |
|
| 167 | ); |
|
| 168 | $table->setPrimaryKey(['cloud_id']); |
|
| 169 | } |
|
| 170 | ||
| 171 | ||
| 172 | if (!$schema->hasTable('circle_groups')) { |
|
| @@ 172-203 (lines=32) @@ | ||
| 169 | } |
|
| 170 | ||
| 171 | ||
| 172 | if (!$schema->hasTable('circle_groups')) { |
|
| 173 | $table = $schema->createTable('circle_groups'); |
|
| 174 | $table->addColumn( |
|
| 175 | 'circle_id', 'string', [ |
|
| 176 | 'notnull' => true, |
|
| 177 | 'length' => 15, |
|
| 178 | ] |
|
| 179 | ); |
|
| 180 | $table->addColumn( |
|
| 181 | 'group_id', 'string', [ |
|
| 182 | 'notnull' => true, |
|
| 183 | 'length' => 64, |
|
| 184 | ] |
|
| 185 | ); |
|
| 186 | $table->addColumn( |
|
| 187 | 'level', 'smallint', [ |
|
| 188 | 'notnull' => true, |
|
| 189 | 'length' => 1, |
|
| 190 | ] |
|
| 191 | ); |
|
| 192 | $table->addColumn( |
|
| 193 | 'note', 'text', [ |
|
| 194 | 'notnull' => false |
|
| 195 | ] |
|
| 196 | ); |
|
| 197 | $table->addColumn( |
|
| 198 | 'joined', 'datetime', [ |
|
| 199 | 'notnull' => false, |
|
| 200 | ] |
|
| 201 | ); |
|
| 202 | $table->setPrimaryKey(['circle_id', 'group_id']); |
|
| 203 | } |
|
| 204 | ||
| 205 | ||
| 206 | if (!$schema->hasTable('circle_gsevents')) { |
|
| @@ 303-330 (lines=28) @@ | ||
| 300 | } |
|
| 301 | ||
| 302 | ||
| 303 | if (!$schema->hasTable('circle_gsshares_mp')) { |
|
| 304 | $table = $schema->createTable('circle_gsshares_mp'); |
|
| 305 | $table->addColumn( |
|
| 306 | 'share_id', 'integer', [ |
|
| 307 | 'length' => 11, |
|
| 308 | 'notnull' => false |
|
| 309 | ] |
|
| 310 | ); |
|
| 311 | $table->addColumn( |
|
| 312 | 'user_id', 'string', [ |
|
| 313 | 'length' => 127, |
|
| 314 | 'notnull' => false |
|
| 315 | ] |
|
| 316 | ); |
|
| 317 | $table->addColumn( |
|
| 318 | 'mountpoint', 'text', [ |
|
| 319 | 'notnull' => false |
|
| 320 | ] |
|
| 321 | ); |
|
| 322 | $table->addColumn( |
|
| 323 | 'mountpoint_hash', 'string', [ |
|
| 324 | 'length' => 64, |
|
| 325 | 'notnull' => false |
|
| 326 | ] |
|
| 327 | ); |
|
| 328 | $table->setPrimaryKey(['share_id', 'user_id']); |
|
| 329 | $table->addUniqueIndex(['share_id', 'mountpoint_hash']); |
|
| 330 | } |
|
| 331 | ||
| 332 | ||
| 333 | if (!$schema->hasTable('circle_links')) { |
|