| @@ 769-791 (lines=23) @@ | ||
| 766 | $table->addIndex(['actor_type', 'actor_id'], 'comments_actor_index'); |
|
| 767 | } |
|
| 768 | ||
| 769 | if (!$schema->hasTable('comments_read_markers')) { |
|
| 770 | $table = $schema->createTable('comments_read_markers'); |
|
| 771 | $table->addColumn('user_id', 'string', [ |
|
| 772 | 'notnull' => true, |
|
| 773 | 'length' => 64, |
|
| 774 | 'default' => '', |
|
| 775 | ]); |
|
| 776 | $table->addColumn('marker_datetime', 'datetime', [ |
|
| 777 | 'notnull' => false, |
|
| 778 | ]); |
|
| 779 | $table->addColumn('object_type', 'string', [ |
|
| 780 | 'notnull' => true, |
|
| 781 | 'length' => 64, |
|
| 782 | 'default' => '', |
|
| 783 | ]); |
|
| 784 | $table->addColumn('object_id', 'string', [ |
|
| 785 | 'notnull' => true, |
|
| 786 | 'length' => 64, |
|
| 787 | 'default' => '', |
|
| 788 | ]); |
|
| 789 | $table->addIndex(['object_type', 'object_id'], 'comments_marker_object_index'); |
|
| 790 | $table->addUniqueIndex(['user_id', 'object_type', 'object_id'], 'comments_marker_index'); |
|
| 791 | } |
|
| 792 | ||
| 793 | if (!$schema->hasTable('credentials')) { |
|
| 794 | $table = $schema->createTable('credentials'); |
|
| @@ 830-854 (lines=25) @@ | ||
| 827 | $table->addUniqueIndex(['class'], 'admin_sections_class'); |
|
| 828 | } |
|
| 829 | ||
| 830 | if (!$schema->hasTable('admin_settings')) { |
|
| 831 | $table = $schema->createTable('admin_settings'); |
|
| 832 | $table->addColumn('id', 'integer', [ |
|
| 833 | 'autoincrement' => true, |
|
| 834 | 'notnull' => true, |
|
| 835 | 'length' => 4, |
|
| 836 | ]); |
|
| 837 | $table->addColumn('class', 'string', [ |
|
| 838 | 'notnull' => true, |
|
| 839 | 'length' => 255, |
|
| 840 | 'default' => '', |
|
| 841 | ]); |
|
| 842 | $table->addColumn('section', 'string', [ |
|
| 843 | 'notnull' => false, |
|
| 844 | 'length' => 64, |
|
| 845 | ]); |
|
| 846 | $table->addColumn('priority', 'smallint', [ |
|
| 847 | 'notnull' => true, |
|
| 848 | 'length' => 1, |
|
| 849 | 'default' => 0, |
|
| 850 | ]); |
|
| 851 | $table->setPrimaryKey(['id']); |
|
| 852 | $table->addUniqueIndex(['class'], 'admin_settings_class'); |
|
| 853 | $table->addIndex(['section'], 'admin_settings_section'); |
|
| 854 | } |
|
| 855 | ||
| 856 | if (!$schema->hasTable('personal_sections')) { |
|
| 857 | $table = $schema->createTable('personal_sections'); |
|
| @@ 876-900 (lines=25) @@ | ||
| 873 | $table->addUniqueIndex(['class'], 'personal_sections_class'); |
|
| 874 | } |
|
| 875 | ||
| 876 | if (!$schema->hasTable('personal_settings')) { |
|
| 877 | $table = $schema->createTable('personal_settings'); |
|
| 878 | $table->addColumn('id', 'integer', [ |
|
| 879 | 'autoincrement' => true, |
|
| 880 | 'notnull' => true, |
|
| 881 | 'length' => 4, |
|
| 882 | ]); |
|
| 883 | $table->addColumn('class', 'string', [ |
|
| 884 | 'notnull' => true, |
|
| 885 | 'length' => 255, |
|
| 886 | 'default' => '', |
|
| 887 | ]); |
|
| 888 | $table->addColumn('section', 'string', [ |
|
| 889 | 'notnull' => false, |
|
| 890 | 'length' => 64, |
|
| 891 | ]); |
|
| 892 | $table->addColumn('priority', 'smallint', [ |
|
| 893 | 'notnull' => true, |
|
| 894 | 'length' => 1, |
|
| 895 | 'default' => 0, |
|
| 896 | ]); |
|
| 897 | $table->setPrimaryKey(['id']); |
|
| 898 | $table->addUniqueIndex(['class'], 'personal_settings_class'); |
|
| 899 | $table->addIndex(['section'], 'personal_settings_section'); |
|
| 900 | } |
|
| 901 | ||
| 902 | if (!$schema->hasTable('accounts')) { |
|
| 903 | $table = $schema->createTable('accounts'); |
|