| @@ 274-301 (lines=28) @@ | ||
| 271 | $table->setPrimaryKey(['userid', 'appid', 'configkey']); |
|
| 272 | } |
|
| 273 | ||
| 274 | if (!$schema->hasTable('properties')) { |
|
| 275 | $table = $schema->createTable('properties'); |
|
| 276 | $table->addColumn('id', 'integer', [ |
|
| 277 | 'autoincrement' => true, |
|
| 278 | 'notnull' => true, |
|
| 279 | 'length' => 4, |
|
| 280 | ]); |
|
| 281 | $table->addColumn('userid', 'string', [ |
|
| 282 | 'notnull' => true, |
|
| 283 | 'length' => 64, |
|
| 284 | 'default' => '', |
|
| 285 | ]); |
|
| 286 | $table->addColumn('propertypath', 'string', [ |
|
| 287 | 'notnull' => true, |
|
| 288 | 'length' => 255, |
|
| 289 | 'default' => '', |
|
| 290 | ]); |
|
| 291 | $table->addColumn('propertyname', 'string', [ |
|
| 292 | 'notnull' => true, |
|
| 293 | 'length' => 255, |
|
| 294 | 'default' => '', |
|
| 295 | ]); |
|
| 296 | $table->addColumn('propertyvalue', 'text', [ |
|
| 297 | 'notnull' => true, |
|
| 298 | ]); |
|
| 299 | $table->setPrimaryKey(['id']); |
|
| 300 | $table->addIndex(['userid'], 'property_index'); |
|
| 301 | } |
|
| 302 | ||
| 303 | if (!$schema->hasTable('share')) { |
|
| 304 | $table = $schema->createTable('share'); |
|
| @@ 544-570 (lines=27) @@ | ||
| 541 | $table->addIndex(['subnet'], 'bruteforce_attempts_subnet'); |
|
| 542 | } |
|
| 543 | ||
| 544 | if (!$schema->hasTable('vcategory')) { |
|
| 545 | $table = $schema->createTable('vcategory'); |
|
| 546 | $table->addColumn('id', 'integer', [ |
|
| 547 | 'autoincrement' => true, |
|
| 548 | 'notnull' => true, |
|
| 549 | 'length' => 4, |
|
| 550 | ]); |
|
| 551 | $table->addColumn('uid', 'string', [ |
|
| 552 | 'notnull' => true, |
|
| 553 | 'length' => 64, |
|
| 554 | 'default' => '', |
|
| 555 | ]); |
|
| 556 | $table->addColumn('type', 'string', [ |
|
| 557 | 'notnull' => true, |
|
| 558 | 'length' => 64, |
|
| 559 | 'default' => '', |
|
| 560 | ]); |
|
| 561 | $table->addColumn('category', 'string', [ |
|
| 562 | 'notnull' => true, |
|
| 563 | 'length' => 255, |
|
| 564 | 'default' => '', |
|
| 565 | ]); |
|
| 566 | $table->setPrimaryKey(['id']); |
|
| 567 | $table->addIndex(['uid'], 'uid_index'); |
|
| 568 | $table->addIndex(['type'], 'type_index'); |
|
| 569 | $table->addIndex(['category'], 'category_index'); |
|
| 570 | } |
|
| 571 | ||
| 572 | if (!$schema->hasTable('vcategory_to_object')) { |
|
| 573 | $table = $schema->createTable('vcategory_to_object'); |
|
| @@ 593-617 (lines=25) @@ | ||
| 590 | $table->addIndex(['objid', 'type'], 'vcategory_objectd_index'); |
|
| 591 | } |
|
| 592 | ||
| 593 | if (!$schema->hasTable('systemtag')) { |
|
| 594 | $table = $schema->createTable('systemtag'); |
|
| 595 | $table->addColumn('id', 'integer', [ |
|
| 596 | 'autoincrement' => true, |
|
| 597 | 'notnull' => true, |
|
| 598 | 'length' => 4, |
|
| 599 | ]); |
|
| 600 | $table->addColumn('name', 'string', [ |
|
| 601 | 'notnull' => true, |
|
| 602 | 'length' => 64, |
|
| 603 | 'default' => '', |
|
| 604 | ]); |
|
| 605 | $table->addColumn('visibility', 'smallint', [ |
|
| 606 | 'notnull' => true, |
|
| 607 | 'length' => 1, |
|
| 608 | 'default' => 1, |
|
| 609 | ]); |
|
| 610 | $table->addColumn('editable', 'smallint', [ |
|
| 611 | 'notnull' => true, |
|
| 612 | 'length' => 1, |
|
| 613 | 'default' => 1, |
|
| 614 | ]); |
|
| 615 | $table->setPrimaryKey(['id']); |
|
| 616 | $table->addUniqueIndex(['name', 'visibility', 'editable'], 'tag_ident'); |
|
| 617 | } |
|
| 618 | ||
| 619 | if (!$schema->hasTable('systemtag_object_mapping')) { |
|
| 620 | $table = $schema->createTable('systemtag_object_mapping'); |
|