| @@ 254-307 (lines=54) @@ | ||
| 251 | } |
|
| 252 | ||
| 253 | ||
| 254 | if (!$schema->hasTable('circle_gsshares')) { |
|
| 255 | $table = $schema->createTable('circle_gsshares'); |
|
| 256 | $table->addColumn( |
|
| 257 | 'id', 'integer', [ |
|
| 258 | 'notnull' => false, |
|
| 259 | 'length' => 11, |
|
| 260 | 'autoincrement' => true, |
|
| 261 | 'unsigned' => true |
|
| 262 | ] |
|
| 263 | ); |
|
| 264 | $table->addColumn( |
|
| 265 | 'circle_id', 'string', [ |
|
| 266 | 'length' => 15, |
|
| 267 | 'notnull' => false |
|
| 268 | ] |
|
| 269 | ); |
|
| 270 | $table->addColumn( |
|
| 271 | 'owner', 'string', [ |
|
| 272 | 'length' => 15, |
|
| 273 | 'notnull' => false |
|
| 274 | ] |
|
| 275 | ); |
|
| 276 | $table->addColumn( |
|
| 277 | 'instance', 'string', [ |
|
| 278 | 'length' => 255, |
|
| 279 | 'notnull' => false |
|
| 280 | ] |
|
| 281 | ); |
|
| 282 | $table->addColumn( |
|
| 283 | 'token', 'string', [ |
|
| 284 | 'notnull' => false, |
|
| 285 | 'length' => 63 |
|
| 286 | ] |
|
| 287 | ); |
|
| 288 | $table->addColumn( |
|
| 289 | 'parent', 'integer', [ |
|
| 290 | 'notnull' => false, |
|
| 291 | 'length' => 11, |
|
| 292 | ] |
|
| 293 | ); |
|
| 294 | $table->addColumn( |
|
| 295 | 'mountpoint', 'text', [ |
|
| 296 | 'notnull' => false |
|
| 297 | ] |
|
| 298 | ); |
|
| 299 | $table->addColumn( |
|
| 300 | 'mountpoint_hash', 'string', [ |
|
| 301 | 'length' => 64, |
|
| 302 | 'notnull' => false |
|
| 303 | ] |
|
| 304 | ); |
|
| 305 | $table->setPrimaryKey(['id']); |
|
| 306 | $table->addUniqueIndex(['circle_id', 'mountpoint_hash']); |
|
| 307 | } |
|
| 308 | ||
| 309 | ||
| 310 | if (!$schema->hasTable('circle_gsshares_mp')) { |
|
| @@ 236-286 (lines=51) @@ | ||
| 233 | } |
|
| 234 | ||
| 235 | ||
| 236 | if (!$schema->hasTable('circle_membership')) { |
|
| 237 | $table = $schema->createTable('circle_membership'); |
|
| 238 | ||
| 239 | $table->addColumn( |
|
| 240 | 'circle_id', 'string', [ |
|
| 241 | 'notnull' => true, |
|
| 242 | 'length' => 15, |
|
| 243 | ] |
|
| 244 | ); |
|
| 245 | $table->addColumn( |
|
| 246 | 'single_id', 'string', [ |
|
| 247 | 'notnull' => true, |
|
| 248 | 'length' => 15, |
|
| 249 | ] |
|
| 250 | ); |
|
| 251 | $table->addColumn( |
|
| 252 | 'level', 'integer', [ |
|
| 253 | 'notnull' => true, |
|
| 254 | 'length' => 1, |
|
| 255 | 'unsigned' => true |
|
| 256 | ] |
|
| 257 | ); |
|
| 258 | $table->addColumn( |
|
| 259 | 'inheritance_first', 'string', [ |
|
| 260 | 'notnull' => true, |
|
| 261 | 'length' => 15, |
|
| 262 | ] |
|
| 263 | ); |
|
| 264 | $table->addColumn( |
|
| 265 | 'inheritance_last', 'string', [ |
|
| 266 | 'notnull' => true, |
|
| 267 | 'length' => 15, |
|
| 268 | ] |
|
| 269 | ); |
|
| 270 | $table->addColumn( |
|
| 271 | 'inheritance_depth', 'integer', [ |
|
| 272 | 'notnull' => true, |
|
| 273 | 'length' => 2, |
|
| 274 | 'unsigned' => true |
|
| 275 | ] |
|
| 276 | ); |
|
| 277 | $table->addColumn( |
|
| 278 | 'inheritance_path', 'text', [ |
|
| 279 | 'notnull' => true |
|
| 280 | ] |
|
| 281 | ); |
|
| 282 | ||
| 283 | $table->addIndex(['single_id']); |
|
| 284 | $table->addUniqueIndex(['single_id', 'circle_id']); |
|
| 285 | $table->addIndex(['inheritance_first', 'inheritance_last', 'circle_id'], 'ifilci'); |
|
| 286 | } |
|
| 287 | ||
| 288 | ||
| 289 | if (!$schema->hasTable('circle_mount')) { |
|