From 5dba66bbb8145ef7ade87934453bab48a7cd29b0 Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Wed, 24 Jan 2024 21:37:12 -0700 Subject: [PATCH] Creates SMF\Db\Schema and descendents Signed-off-by: Jon Stovell --- .gitignore | 1 + Sources/Db/Schema/Column.php | 202 ++ Sources/Db/Schema/Index.php | 134 ++ Sources/Db/Schema/Table.php | 126 ++ Sources/Db/Schema/v3_0/AdminInfoFiles.php | 141 ++ Sources/Db/Schema/v3_0/ApprovalQueue.php | 74 + Sources/Db/Schema/v3_0/Attachments.php | 191 ++ Sources/Db/Schema/v3_0/BackgroundTasks.php | 95 + Sources/Db/Schema/v3_0/BanGroups.php | 128 ++ Sources/Db/Schema/v3_0/BanItems.php | 127 ++ Sources/Db/Schema/v3_0/BoardPermissions.php | 1629 +++++++++++++++++ .../Db/Schema/v3_0/BoardPermissionsView.php | 98 + Sources/Db/Schema/v3_0/Boards.php | 235 +++ Sources/Db/Schema/v3_0/Calendar.php | 148 ++ Sources/Db/Schema/v3_0/CalendarHolidays.php | 625 +++++++ Sources/Db/Schema/v3_0/Categories.php | 101 + Sources/Db/Schema/v3_0/CustomFields.php | 279 +++ Sources/Db/Schema/v3_0/GroupModerators.php | 76 + Sources/Db/Schema/v3_0/LogActions.php | 165 ++ Sources/Db/Schema/v3_0/LogActivity.php | 103 ++ Sources/Db/Schema/v3_0/LogBanned.php | 101 + Sources/Db/Schema/v3_0/LogBoards.php | 83 + Sources/Db/Schema/v3_0/LogComments.php | 146 ++ Sources/Db/Schema/v3_0/LogDigest.php | 88 + Sources/Db/Schema/v3_0/LogErrors.php | 151 ++ Sources/Db/Schema/v3_0/LogFloodcontrol.php | 95 + Sources/Db/Schema/v3_0/LogMarkRead.php | 83 + Sources/Db/Schema/v3_0/LogMemberNotices.php | 81 + Sources/Db/Schema/v3_0/LogNotify.php | 97 + Sources/Db/Schema/v3_0/LogOnline.php | 125 ++ Sources/Db/Schema/v3_0/LogPolls.php | 86 + Sources/Db/Schema/v3_0/LogReported.php | 176 ++ .../Db/Schema/v3_0/LogReportedComments.php | 122 ++ Sources/Db/Schema/v3_0/LogScheduledTasks.php | 86 + Sources/Db/Schema/v3_0/LogSearchMessages.php | 76 + Sources/Db/Schema/v3_0/LogSearchResults.php | 97 + Sources/Db/Schema/v3_0/LogSearchSubjects.php | 82 + Sources/Db/Schema/v3_0/LogSearchTopics.php | 76 + Sources/Db/Schema/v3_0/LogSpiderHits.php | 102 ++ Sources/Db/Schema/v3_0/LogSpiderStats.php | 88 + Sources/Db/Schema/v3_0/LogSubscribed.php | 160 ++ Sources/Db/Schema/v3_0/LogTopics.php | 95 + Sources/Db/Schema/v3_0/MailQueue.php | 130 ++ Sources/Db/Schema/v3_0/MemberLogins.php | 102 ++ Sources/Db/Schema/v3_0/Membergroups.php | 211 +++ Sources/Db/Schema/v3_0/Members.php | 461 +++++ Sources/Db/Schema/v3_0/Mentions.php | 104 ++ Sources/Db/Schema/v3_0/MessageIcons.php | 169 ++ Sources/Db/Schema/v3_0/Messages.php | 265 +++ Sources/Db/Schema/v3_0/ModeratorGroups.php | 76 + Sources/Db/Schema/v3_0/Moderators.php | 76 + Sources/Db/Schema/v3_0/PackageServers.php | 105 ++ Sources/Db/Schema/v3_0/PermissionProfiles.php | 92 + Sources/Db/Schema/v3_0/Permissions.php | 286 +++ Sources/Db/Schema/v3_0/PersonalMessages.php | 135 ++ Sources/Db/Schema/v3_0/PmLabeledMessages.php | 76 + Sources/Db/Schema/v3_0/PmLabels.php | 83 + Sources/Db/Schema/v3_0/PmRecipients.php | 119 ++ Sources/Db/Schema/v3_0/PmRules.php | 118 ++ Sources/Db/Schema/v3_0/PollChoices.php | 90 + Sources/Db/Schema/v3_0/Polls.php | 145 ++ Sources/Db/Schema/v3_0/Qanda.php | 94 + Sources/Db/Schema/v3_0/ScheduledTasks.php | 243 +++ Sources/Db/Schema/v3_0/Sessions.php | 82 + Sources/Db/Schema/v3_0/Settings.php | 891 +++++++++ Sources/Db/Schema/v3_0/SmileyFiles.php | 84 + Sources/Db/Schema/v3_0/Smileys.php | 104 ++ Sources/Db/Schema/v3_0/Spiders.php | 191 ++ Sources/Db/Schema/v3_0/Subscriptions.php | 143 ++ Sources/Db/Schema/v3_0/Themes.php | 149 ++ Sources/Db/Schema/v3_0/Topics.php | 242 +++ Sources/Db/Schema/v3_0/UserAlerts.php | 142 ++ Sources/Db/Schema/v3_0/UserAlertsPrefs.php | 228 +++ Sources/Db/Schema/v3_0/UserDrafts.php | 163 ++ Sources/Db/Schema/v3_0/UserLikes.php | 103 ++ other/install_3-0_MySQL.sql | 10 +- 76 files changed, 12684 insertions(+), 2 deletions(-) create mode 100644 Sources/Db/Schema/Column.php create mode 100644 Sources/Db/Schema/Index.php create mode 100644 Sources/Db/Schema/Table.php create mode 100644 Sources/Db/Schema/v3_0/AdminInfoFiles.php create mode 100644 Sources/Db/Schema/v3_0/ApprovalQueue.php create mode 100644 Sources/Db/Schema/v3_0/Attachments.php create mode 100644 Sources/Db/Schema/v3_0/BackgroundTasks.php create mode 100644 Sources/Db/Schema/v3_0/BanGroups.php create mode 100644 Sources/Db/Schema/v3_0/BanItems.php create mode 100644 Sources/Db/Schema/v3_0/BoardPermissions.php create mode 100644 Sources/Db/Schema/v3_0/BoardPermissionsView.php create mode 100644 Sources/Db/Schema/v3_0/Boards.php create mode 100644 Sources/Db/Schema/v3_0/Calendar.php create mode 100644 Sources/Db/Schema/v3_0/CalendarHolidays.php create mode 100644 Sources/Db/Schema/v3_0/Categories.php create mode 100644 Sources/Db/Schema/v3_0/CustomFields.php create mode 100644 Sources/Db/Schema/v3_0/GroupModerators.php create mode 100644 Sources/Db/Schema/v3_0/LogActions.php create mode 100644 Sources/Db/Schema/v3_0/LogActivity.php create mode 100644 Sources/Db/Schema/v3_0/LogBanned.php create mode 100644 Sources/Db/Schema/v3_0/LogBoards.php create mode 100644 Sources/Db/Schema/v3_0/LogComments.php create mode 100644 Sources/Db/Schema/v3_0/LogDigest.php create mode 100644 Sources/Db/Schema/v3_0/LogErrors.php create mode 100644 Sources/Db/Schema/v3_0/LogFloodcontrol.php create mode 100644 Sources/Db/Schema/v3_0/LogMarkRead.php create mode 100644 Sources/Db/Schema/v3_0/LogMemberNotices.php create mode 100644 Sources/Db/Schema/v3_0/LogNotify.php create mode 100644 Sources/Db/Schema/v3_0/LogOnline.php create mode 100644 Sources/Db/Schema/v3_0/LogPolls.php create mode 100644 Sources/Db/Schema/v3_0/LogReported.php create mode 100644 Sources/Db/Schema/v3_0/LogReportedComments.php create mode 100644 Sources/Db/Schema/v3_0/LogScheduledTasks.php create mode 100644 Sources/Db/Schema/v3_0/LogSearchMessages.php create mode 100644 Sources/Db/Schema/v3_0/LogSearchResults.php create mode 100644 Sources/Db/Schema/v3_0/LogSearchSubjects.php create mode 100644 Sources/Db/Schema/v3_0/LogSearchTopics.php create mode 100644 Sources/Db/Schema/v3_0/LogSpiderHits.php create mode 100644 Sources/Db/Schema/v3_0/LogSpiderStats.php create mode 100644 Sources/Db/Schema/v3_0/LogSubscribed.php create mode 100644 Sources/Db/Schema/v3_0/LogTopics.php create mode 100644 Sources/Db/Schema/v3_0/MailQueue.php create mode 100644 Sources/Db/Schema/v3_0/MemberLogins.php create mode 100644 Sources/Db/Schema/v3_0/Membergroups.php create mode 100644 Sources/Db/Schema/v3_0/Members.php create mode 100644 Sources/Db/Schema/v3_0/Mentions.php create mode 100644 Sources/Db/Schema/v3_0/MessageIcons.php create mode 100644 Sources/Db/Schema/v3_0/Messages.php create mode 100644 Sources/Db/Schema/v3_0/ModeratorGroups.php create mode 100644 Sources/Db/Schema/v3_0/Moderators.php create mode 100644 Sources/Db/Schema/v3_0/PackageServers.php create mode 100644 Sources/Db/Schema/v3_0/PermissionProfiles.php create mode 100644 Sources/Db/Schema/v3_0/Permissions.php create mode 100644 Sources/Db/Schema/v3_0/PersonalMessages.php create mode 100644 Sources/Db/Schema/v3_0/PmLabeledMessages.php create mode 100644 Sources/Db/Schema/v3_0/PmLabels.php create mode 100644 Sources/Db/Schema/v3_0/PmRecipients.php create mode 100644 Sources/Db/Schema/v3_0/PmRules.php create mode 100644 Sources/Db/Schema/v3_0/PollChoices.php create mode 100644 Sources/Db/Schema/v3_0/Polls.php create mode 100644 Sources/Db/Schema/v3_0/Qanda.php create mode 100644 Sources/Db/Schema/v3_0/ScheduledTasks.php create mode 100644 Sources/Db/Schema/v3_0/Sessions.php create mode 100644 Sources/Db/Schema/v3_0/Settings.php create mode 100644 Sources/Db/Schema/v3_0/SmileyFiles.php create mode 100644 Sources/Db/Schema/v3_0/Smileys.php create mode 100644 Sources/Db/Schema/v3_0/Spiders.php create mode 100644 Sources/Db/Schema/v3_0/Subscriptions.php create mode 100644 Sources/Db/Schema/v3_0/Themes.php create mode 100644 Sources/Db/Schema/v3_0/Topics.php create mode 100644 Sources/Db/Schema/v3_0/UserAlerts.php create mode 100644 Sources/Db/Schema/v3_0/UserAlertsPrefs.php create mode 100644 Sources/Db/Schema/v3_0/UserDrafts.php create mode 100644 Sources/Db/Schema/v3_0/UserLikes.php diff --git a/.gitignore b/.gitignore index a7a975ea6fd..ce93b1900c3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ !/Languages/en_US/ /Languages/en_US/agreement.txt Settings.php +!Sources/Db/Schema/*/Settings.php Settings_bak.php Settings_org.php db_last_error.php diff --git a/Sources/Db/Schema/Column.php b/Sources/Db/Schema/Column.php new file mode 100644 index 00000000000..45f0887cd4b --- /dev/null +++ b/Sources/Db/Schema/Column.php @@ -0,0 +1,202 @@ +name = strtolower($name); + $this->type = strtolower($type); + + if (isset($default)) { + $this->default = $default === 'NULL' ? null : $default; + } + + foreach (['auto', 'size', 'unsigned', 'not_null'] as $var) { + if (isset($var)) { + $this->{$var} = ${$var}; + } + } + + if (isset($charset)) { + $this->charset = strtolower($charset); + } + } + + /** + * Adds this column to the specified table. + * + * @see SMF\Db\DatabaseApi::add_column + * + * @param string $table_name The name of the table to add the column to. + * @param string $if_exists What to do if the column exists. + * If 'update', column is updated. + * @return bool Whether or not the operation was successful. + */ + public function add(string $table_name, string $if_exists = 'update'): bool + { + return Db::$db->add_column( + $table_name, + get_object_vars($this), + [], + $if_exists, + ); + } + + /** + * Updates the column in the database to match the definition given by this + * object's properties. + * + * @see SMF\Db\DatabaseApi::change_column + * + * @param string $table_name Name of the table that contains this column. + * @return bool Whether or not the operation was successful. + */ + public function alter(string $table_name): bool + { + return Db::$db->change_column( + $table_name, + $this->name, + get_object_vars($this), + ); + } + + /** + * Drops this column from the specified table. + * + * @see SMF\Db\DatabaseApi::remove_column + * + * @param string $table_name The name of the table to drop the column from. + * @return bool Whether or not the operation was successful. + */ + public function drop(string $table_name): bool + { + return Db::$db->remove_column( + $table_name, + $this->name, + ); + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/Index.php b/Sources/Db/Schema/Index.php new file mode 100644 index 00000000000..aec6f81d076 --- /dev/null +++ b/Sources/Db/Schema/Index.php @@ -0,0 +1,134 @@ +columns = array_map('strtolower', $columns); + + $this->type = isset($type) ? strtolower((string) $type) : null; + + if (($this->type ?? null) !== 'primary') { + $this->name = $name ?? 'idx_' . trim(implode('_', preg_replace(['/\s*/', '/\(\d+\)/'], ['', ''], $this->columns))); + } + } + + /** + * Adds this index to the specified table. + * + * @see SMF\Db\DatabaseApi::add_index + * + * @param string $table_name The name of the table to add the index to. + * @param string $if_exists What to do if the index exists. + * If 'update', index is updated. + * @return bool Whether or not the operation was successful. + */ + public function add(string $table_name, string $if_exists = 'update'): bool + { + return Db::$db->add_index( + $table_name, + get_object_vars($this), + [], + $if_exists, + ); + } + + /** + * Updates the index in the database to match the definition given by this + * object's properties. + * + * @param string $table_name Name of the table that contains this index. + * @return bool Whether or not the operation was successful. + */ + public function alter(string $table_name): bool + { + // This method is really just a convenient way to replace an existing index. + $this->drop($table_name); + + return $this->add($table_name); + } + + /** + * Drops this column from the specified table. + * + * @see SMF\Db\DatabaseApi::remove_column + * + * @param string $table_name The name of the table to drop the column from. + * @return bool Whether or not the operation was successful. + */ + public function drop(string $table_name): bool + { + return Db::$db->remove_index( + $table_name, + $this->name, + ); + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/Table.php b/Sources/Db/Schema/Table.php new file mode 100644 index 00000000000..8e1510e5c74 --- /dev/null +++ b/Sources/Db/Schema/Table.php @@ -0,0 +1,126 @@ +create_table( + $this->name, + array_map('get_object_vars', $this->columns), + array_map('get_object_vars', $this->indices), + $parameters, + $if_exists, + ); + } + + /** + * Drop the table from the database. + * + * @see SMF\Db\DatabaseApi::drop_table + * + * @return bool Whether or not the operation was successful. + */ + public function drop(): bool + { + return Db::$db->drop_table($this->name); + } + + /** + * Get the table's current structure as it exists in the database. + * + * @see SMF\Db\DatabaseApi::table_structure + * + * @return array An array of table structure info: the name, the column + * info from SMF\Db\DatabaseApi::list_columns() and index info from + * SMF\Db\DatabaseApi::list_indexes(). + */ + public function getStructure(): array + { + return Db::$db->table_structure($this->name); + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/AdminInfoFiles.php b/Sources/Db/Schema/v3_0/AdminInfoFiles.php new file mode 100644 index 00000000000..94cd2f104b1 --- /dev/null +++ b/Sources/Db/Schema/v3_0/AdminInfoFiles.php @@ -0,0 +1,141 @@ + 1, + 'filename' => 'current-version.js', + 'path' => '/smf/', + 'parameters' => 'version=%3$s', + 'data' => '', + 'filetype' => 'text/javascript', + ], + [ + 'id_file' => 2, + 'filename' => 'detailed-version.js', + 'path' => '/smf/', + 'parameters' => 'language=%1$s&version=%3$s', + 'data' => '', + 'filetype' => 'text/javascript', + ], + [ + 'id_file' => 3, + 'filename' => 'latest-news.js', + 'path' => '/smf/', + 'parameters' => 'language=%1$s&format=%2$s', + 'data' => '', + 'filetype' => 'text/javascript', + ], + [ + 'id_file' => 4, + 'filename' => 'latest-versions.txt', + 'path' => '/smf/', + 'parameters' => 'version=%3$s', + 'data' => '', + 'filetype' => 'text/plain', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'admin_info_files'; + + $this->columns = [ + new Column( + name: 'id_file', + type: 'tinyint', + unsigned: true, + auto: true, + ), + new Column( + name: 'filename', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'path', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'parameters', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'data', + type: 'text', + not_null: true, + ), + new Column( + name: 'filetype', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_file', + ], + ), + new Index( + name: 'idx_filename', + columns: [ + 'filename(30)', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/ApprovalQueue.php b/Sources/Db/Schema/v3_0/ApprovalQueue.php new file mode 100644 index 00000000000..7cbc20fa2ce --- /dev/null +++ b/Sources/Db/Schema/v3_0/ApprovalQueue.php @@ -0,0 +1,74 @@ +name = 'approval_queue'; + + $this->columns = [ + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_attach', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_event', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Attachments.php b/Sources/Db/Schema/v3_0/Attachments.php new file mode 100644 index 00000000000..3560af0f9bb --- /dev/null +++ b/Sources/Db/Schema/v3_0/Attachments.php @@ -0,0 +1,191 @@ +name = 'attachments'; + + $this->columns = [ + new Column( + name: 'id_attach', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_thumb', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_folder', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'attachment_type', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'filename', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'file_hash', + type: 'varchar', + size: 40, + not_null: true, + default: '', + ), + new Column( + name: 'fileext', + type: 'varchar', + size: 8, + not_null: true, + default: '', + ), + new Column( + name: 'size', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'downloads', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'width', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'height', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'mime_type', + type: 'varchar', + size: 128, + not_null: true, + default: '', + ), + new Column( + name: 'approved', + type: 'tinyint', + not_null: true, + default: 1, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_attach', + ], + ), + new Index( + name: 'idx_id_member', + type: 'unique', + columns: [ + 'id_member', + 'id_attach', + ], + ), + new Index( + name: 'idx_id_msg', + columns: [ + 'id_msg', + ], + ), + new Index( + name: 'idx_attachment_type', + columns: [ + 'attachment_type', + ], + ), + new Index( + name: 'idx_id_thumb', + columns: [ + 'id_thumb', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/BackgroundTasks.php b/Sources/Db/Schema/v3_0/BackgroundTasks.php new file mode 100644 index 00000000000..ffb45eeabe1 --- /dev/null +++ b/Sources/Db/Schema/v3_0/BackgroundTasks.php @@ -0,0 +1,95 @@ +name = 'background_tasks'; + + $this->columns = [ + new Column( + name: 'id_task', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'task_file', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'task_class', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'task_data', + type: 'mediumtext', + not_null: true, + ), + new Column( + name: 'claimed_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_task', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/BanGroups.php b/Sources/Db/Schema/v3_0/BanGroups.php new file mode 100644 index 00000000000..e4df98deca4 --- /dev/null +++ b/Sources/Db/Schema/v3_0/BanGroups.php @@ -0,0 +1,128 @@ +name = 'ban_groups'; + + $this->columns = [ + new Column( + name: 'id_ban_group', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'name', + type: 'varchar', + size: 20, + not_null: true, + default: '', + ), + new Column( + name: 'ban_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'expire_time', + type: 'int', + unsigned: true, + ), + new Column( + name: 'cannot_access', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'cannot_register', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'cannot_post', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'cannot_login', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'reason', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'notes', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_ban_group', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/BanItems.php b/Sources/Db/Schema/v3_0/BanItems.php new file mode 100644 index 00000000000..51daa7d9597 --- /dev/null +++ b/Sources/Db/Schema/v3_0/BanItems.php @@ -0,0 +1,127 @@ +name = 'ban_items'; + + $this->columns = [ + new Column( + name: 'id_ban', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_ban_group', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'ip_low', + type: 'inet', + size: 16, + ), + new Column( + name: 'ip_high', + type: 'inet', + size: 16, + ), + new Column( + name: 'hostname', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'email_address', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'hits', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_ban', + ], + ), + new Index( + name: 'idx_id_ban_group', + columns: [ + 'id_ban_group', + ], + ), + new Index( + name: 'idx_id_ban_ip', + columns: [ + 'ip_low', + 'ip_high', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/BoardPermissions.php b/Sources/Db/Schema/v3_0/BoardPermissions.php new file mode 100644 index 00000000000..c5d80de2c1d --- /dev/null +++ b/Sources/Db/Schema/v3_0/BoardPermissions.php @@ -0,0 +1,1629 @@ + -1, + 'id_profile' => 1, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'remove_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'poll_add_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'poll_edit_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'poll_lock_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_new', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'report_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 1, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_new', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'report_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'move_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'split_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 2, + 'id_profile' => 1, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_new', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'report_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'move_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'split_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 3, + 'id_profile' => 1, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => -1, + 'id_profile' => 2, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'remove_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_new', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'report_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 2, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_new', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'report_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'move_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'split_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 2, + 'id_profile' => 2, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_new', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'report_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'move_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'split_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 3, + 'id_profile' => 2, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => -1, + 'id_profile' => 3, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'remove_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'report_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 3, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_new', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'report_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'move_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'split_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 2, + 'id_profile' => 3, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_new', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'report_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'move_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'split_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 3, + 'id_profile' => 3, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => -1, + 'id_profile' => 4, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 4, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 0, + 'id_profile' => 4, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 0, + 'id_profile' => 4, + 'permission' => 'report_any', + ], + [ + 'id_group' => 0, + 'id_profile' => 4, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_new', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'report_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'move_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'split_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 2, + 'id_profile' => 4, + 'permission' => 'view_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'moderate_board', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_new', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_draft', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_reply_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_reply_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_unapproved_topics', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_unapproved_replies_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_unapproved_replies_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_unapproved_attachments', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_post', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_add_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_view', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_vote', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'poll_edit_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'report_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'lock_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'delete_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'modify_own', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'make_sticky', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'lock_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'remove_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'move_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'merge_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'split_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'delete_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'modify_any', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'approve_posts', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'post_attachment', + ], + [ + 'id_group' => 3, + 'id_profile' => 4, + 'permission' => 'view_attachments', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'board_permissions'; + + $this->columns = [ + new Column( + name: 'id_group', + type: 'smallint', + default: 0, + ), + new Column( + name: 'id_profile', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'permission', + type: 'varchar', + size: 30, + default: '', + ), + new Column( + name: 'add_deny', + type: 'tinyint', + not_null: true, + default: 1, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_group', + 'id_profile', + 'permission', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/BoardPermissionsView.php b/Sources/Db/Schema/v3_0/BoardPermissionsView.php new file mode 100644 index 00000000000..80c615b108c --- /dev/null +++ b/Sources/Db/Schema/v3_0/BoardPermissionsView.php @@ -0,0 +1,98 @@ + -1, + 'id_board' => 1, + 'deny' => 0, + ], + [ + 'id_group' => 0, + 'id_board' => 1, + 'deny' => 0, + ], + [ + 'id_group' => 2, + 'id_board' => 1, + 'deny' => 0, + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'board_permissions_view'; + + $this->columns = [ + new Column( + name: 'id_group', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + ), + new Column( + name: 'deny', + type: 'smallint', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_group', + 'id_board', + 'deny', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Boards.php b/Sources/Db/Schema/v3_0/Boards.php new file mode 100644 index 00000000000..a62878d3aa1 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Boards.php @@ -0,0 +1,235 @@ + 1, + 'id_cat' => 1, + 'board_order' => 1, + 'id_last_msg' => 1, + 'id_msg_updated' => 1, + 'name' => '{$default_board_name}', + 'description' => '{$default_board_description}', + 'num_topics' => 1, + 'num_posts' => 1, + 'member_groups' => '-1,0,2', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'boards'; + + $this->columns = [ + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_cat', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'child_level', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_parent', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'board_order', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_last_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_msg_updated', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'member_groups', + type: 'varchar', + size: 255, + not_null: true, + default: '-1,0', + ), + new Column( + name: 'id_profile', + type: 'smallint', + unsigned: true, + not_null: true, + default: 1, + ), + new Column( + name: 'name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'description', + type: 'text', + not_null: true, + ), + new Column( + name: 'num_topics', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'num_posts', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'count_posts', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_theme', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'override_theme', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'unapproved_posts', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'unapproved_topics', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'redirect', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'deny_member_groups', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_board', + ], + ), + new Index( + name: 'idx_categories', + type: 'unique', + columns: [ + 'id_cat', + 'id_board', + ], + ), + new Index( + name: 'idx_id_parent', + columns: [ + 'id_parent', + ], + ), + new Index( + name: 'idx_id_msg_updated', + columns: [ + 'id_msg_updated', + ], + ), + new Index( + name: 'idx_member_groups', + columns: [ + 'member_groups(48)', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Calendar.php b/Sources/Db/Schema/v3_0/Calendar.php new file mode 100644 index 00000000000..eb25e1f19f6 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Calendar.php @@ -0,0 +1,148 @@ +name = 'calendar'; + + $this->columns = [ + new Column( + name: 'id_event', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'start_date', + type: 'date', + not_null: true, + default: '1004-01-01', + ), + new Column( + name: 'end_date', + type: 'date', + not_null: true, + default: '1004-01-01', + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'title', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'start_time', + type: 'time', + ), + new Column( + name: 'end_time', + type: 'time', + ), + new Column( + name: 'timezone', + type: 'varchar', + size: 80, + ), + new Column( + name: 'location', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_event', + ], + ), + new Index( + name: 'idx_start_date', + columns: [ + 'start_date', + ], + ), + new Index( + name: 'idx_end_date', + columns: [ + 'end_date', + ], + ), + new Index( + name: 'idx_topic', + columns: [ + 'id_topic', + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/CalendarHolidays.php b/Sources/Db/Schema/v3_0/CalendarHolidays.php new file mode 100644 index 00000000000..a3357072807 --- /dev/null +++ b/Sources/Db/Schema/v3_0/CalendarHolidays.php @@ -0,0 +1,625 @@ + 'New Year\'s', + 'event_date' => '1004-01-01', + ], + [ + 'title' => 'Christmas', + 'event_date' => '1004-12-25', + ], + [ + 'title' => 'Valentine\'s Day', + 'event_date' => '1004-02-14', + ], + [ + 'title' => 'St. Patrick\'s Day', + 'event_date' => '1004-03-17', + ], + [ + 'title' => 'April Fools', + 'event_date' => '1004-04-01', + ], + [ + 'title' => 'Earth Day', + 'event_date' => '1004-04-22', + ], + [ + 'title' => 'United Nations Day', + 'event_date' => '1004-10-24', + ], + [ + 'title' => 'Halloween', + 'event_date' => '1004-10-31', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2010-05-09', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2011-05-08', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2012-05-13', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2013-05-12', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2014-05-11', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2015-05-10', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2016-05-08', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2017-05-14', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2018-05-13', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2019-05-12', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2020-05-10', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2021-05-09', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2022-05-08', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2023-05-14', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2024-05-12', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2025-05-11', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2026-05-10', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2027-05-09', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2028-05-14', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2029-05-13', + ], + [ + 'title' => 'Mother\'s Day', + 'event_date' => '2030-05-12', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2010-06-20', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2011-06-19', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2012-06-17', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2013-06-16', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2014-06-15', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2015-06-21', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2016-06-19', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2017-06-18', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2018-06-17', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2019-06-16', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2020-06-21', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2021-06-20', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2022-06-19', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2023-06-18', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2024-06-16', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2025-06-15', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2026-06-21', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2027-06-20', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2028-06-18', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2029-06-17', + ], + [ + 'title' => 'Father\'s Day', + 'event_date' => '2030-06-16', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2010-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2011-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2012-06-20', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2013-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2014-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2015-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2016-06-20', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2017-06-20', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2018-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2019-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2020-06-20', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2021-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2022-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2023-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2024-06-20', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2025-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2026-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2027-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2028-06-20', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2029-06-21', + ], + [ + 'title' => 'Summer Solstice', + 'event_date' => '2030-06-21', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2010-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2011-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2012-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2013-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2014-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2015-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2016-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2017-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2018-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2019-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2020-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2021-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2022-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2023-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2024-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2025-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2026-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2027-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2028-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2029-03-20', + ], + [ + 'title' => 'Vernal Equinox', + 'event_date' => '2030-03-20', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2010-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2011-12-22', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2012-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2013-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2014-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2015-12-22', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2016-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2017-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2018-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2019-12-22', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2020-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2021-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2022-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2023-12-22', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2024-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2025-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2026-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2027-12-22', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2028-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2029-12-21', + ], + [ + 'title' => 'Winter Solstice', + 'event_date' => '2030-12-21', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2010-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2011-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2012-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2013-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2014-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2015-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2016-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2017-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2018-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2019-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2020-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2021-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2022-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2023-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2024-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2025-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2026-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2027-09-23', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2028-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2029-09-22', + ], + [ + 'title' => 'Autumnal Equinox', + 'event_date' => '2030-09-22', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'calendar_holidays'; + + $this->columns = [ + new Column( + name: 'id_holiday', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'event_date', + type: 'date', + not_null: true, + default: '1004-01-01', + ), + new Column( + name: 'title', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_holiday', + ], + ), + new Index( + name: 'idx_event_date', + columns: [ + 'event_date', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Categories.php b/Sources/Db/Schema/v3_0/Categories.php new file mode 100644 index 00000000000..519d63d7236 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Categories.php @@ -0,0 +1,101 @@ + 1, + 'cat_order' => 0, + 'name' => '{$default_category_name}', + 'description' => '', + 'can_collapse' => 1, + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'categories'; + + $this->columns = [ + new Column( + name: 'id_cat', + type: 'tinyint', + unsigned: true, + auto: true, + ), + new Column( + name: 'cat_order', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'description', + type: 'text', + not_null: true, + ), + new Column( + name: 'can_collapse', + type: 'tinyint', + not_null: true, + default: 1, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_cat', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/CustomFields.php b/Sources/Db/Schema/v3_0/CustomFields.php new file mode 100644 index 00000000000..46f95371786 --- /dev/null +++ b/Sources/Db/Schema/v3_0/CustomFields.php @@ -0,0 +1,279 @@ + 'cust_icq', + 'field_name' => '{icq}', + 'field_desc' => '{icq_desc}', + 'field_type' => 'text', + 'field_length' => 12, + 'field_options' => '', + 'field_order' => 1, + 'mask' => 'regex~[1-9][0-9]{4,9}~i', + 'show_reg' => 0, + 'show_display' => 1, + 'show_mlist' => 0, + 'show_profile' => 'forumprofile', + 'private' => 0, + 'active' => 1, + 'bbc' => 0, + 'can_search' => 0, + 'default_value' => '', + 'enclose' => 'ICQ - {INPUT}', + 'placement' => 1, + ], + [ + 'col_name' => 'cust_skype', + 'field_name' => '{skype}', + 'field_desc' => '{skype_desc}', + 'field_type' => 'text', + 'field_length' => 32, + 'field_options' => '', + 'field_order' => 2, + 'mask' => 'nohtml', + 'show_reg' => 0, + 'show_display' => 1, + 'show_mlist' => 0, + 'show_profile' => 'forumprofile', + 'private' => 0, + 'active' => 1, + 'bbc' => 0, + 'can_search' => 0, + 'default_value' => '', + 'enclose' => '{INPUT} ', + 'placement' => 1, + ], + [ + 'col_name' => 'cust_loca', + 'field_name' => '{location}', + 'field_desc' => '{location_desc}', + 'field_type' => 'text', + 'field_length' => 50, + 'field_options' => '', + 'field_order' => 4, + 'mask' => 'nohtml', + 'show_reg' => 0, + 'show_display' => 1, + 'show_mlist' => 0, + 'show_profile' => 'forumprofile', + 'private' => 0, + 'active' => 1, + 'bbc' => 0, + 'can_search' => 0, + 'default_value' => '', + 'enclose' => '', + 'placement' => 0, + ], + [ + 'col_name' => 'cust_gender', + 'field_name' => '{gender}', + 'field_desc' => '{gender_desc}', + 'field_type' => 'radio', + 'field_length' => 255, + 'field_options' => '{gender_0},{gender_1},{gender_2}', + 'field_order' => 5, + 'mask' => 'nohtml', + 'show_reg' => 1, + 'show_display' => 1, + 'show_mlist' => 0, + 'show_profile' => 'forumprofile', + 'private' => 0, + 'active' => 1, + 'bbc' => 0, + 'can_search' => 0, + 'default_value' => '{gender_0}', + 'enclose' => '', + 'placement' => 1, + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'custom_fields'; + + $this->columns = [ + new Column( + name: 'id_field', + type: 'smallint', + auto: true, + ), + new Column( + name: 'col_name', + type: 'varchar', + size: 12, + not_null: true, + default: '', + ), + new Column( + name: 'field_name', + type: 'varchar', + size: 40, + not_null: true, + default: '', + ), + new Column( + name: 'field_desc', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'field_type', + type: 'varchar', + size: 8, + not_null: true, + default: 'text', + ), + new Column( + name: 'field_length', + type: 'smallint', + not_null: true, + default: 255, + ), + new Column( + name: 'field_options', + type: 'text', + not_null: true, + ), + new Column( + name: 'field_order', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'mask', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'show_reg', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'show_display', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'show_mlist', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'show_profile', + type: 'varchar', + size: 20, + not_null: true, + default: 'forumprofile', + ), + new Column( + name: 'private', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'active', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'bbc', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'can_search', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'default_value', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'enclose', + type: 'text', + not_null: true, + ), + new Column( + name: 'placement', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_field', + ], + ), + new Index( + name: 'idx_col_name', + type: 'unique', + columns: [ + 'col_name', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/GroupModerators.php b/Sources/Db/Schema/v3_0/GroupModerators.php new file mode 100644 index 00000000000..1d588e6518e --- /dev/null +++ b/Sources/Db/Schema/v3_0/GroupModerators.php @@ -0,0 +1,76 @@ +name = 'group_moderators'; + + $this->columns = [ + new Column( + name: 'id_group', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_group', + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogActions.php b/Sources/Db/Schema/v3_0/LogActions.php new file mode 100644 index 00000000000..022eab30b0f --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogActions.php @@ -0,0 +1,165 @@ +name = 'log_actions'; + + $this->columns = [ + new Column( + name: 'id_action', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_log', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 1, + ), + new Column( + name: 'log_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'action', + type: 'varchar', + size: 30, + not_null: true, + default: '', + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'extra', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_action', + ], + ), + new Index( + name: 'idx_id_log', + columns: [ + 'id_log', + ], + ), + new Index( + name: 'idx_log_time', + columns: [ + 'log_time', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_id_board', + columns: [ + 'id_board', + ], + ), + new Index( + name: 'idx_id_msg', + columns: [ + 'id_msg', + ], + ), + new Index( + name: 'idx_id_topic_id_log', + columns: [ + 'id_topic', + 'id_log', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogActivity.php b/Sources/Db/Schema/v3_0/LogActivity.php new file mode 100644 index 00000000000..5868bfa16b5 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogActivity.php @@ -0,0 +1,103 @@ +name = 'log_activity'; + + $this->columns = [ + new Column( + name: 'date', + type: 'date', + not_null: true, + ), + new Column( + name: 'hits', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'topics', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'posts', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'registers', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'most_on', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'date', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogBanned.php b/Sources/Db/Schema/v3_0/LogBanned.php new file mode 100644 index 00000000000..7a321eb4d85 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogBanned.php @@ -0,0 +1,101 @@ +name = 'log_banned'; + + $this->columns = [ + new Column( + name: 'id_ban_log', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'email', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'log_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_ban_log', + ], + ), + new Index( + name: 'idx_log_time', + columns: [ + 'log_time', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogBoards.php b/Sources/Db/Schema/v3_0/LogBoards.php new file mode 100644 index 00000000000..aadcd47cd08 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogBoards.php @@ -0,0 +1,83 @@ +name = 'log_boards'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_member', + 'id_board', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogComments.php b/Sources/Db/Schema/v3_0/LogComments.php new file mode 100644 index 00000000000..7e8bfb9a99c --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogComments.php @@ -0,0 +1,146 @@ +name = 'log_comments'; + + $this->columns = [ + new Column( + name: 'id_comment', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'member_name', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'comment_type', + type: 'varchar', + size: 8, + not_null: true, + default: 'warning', + ), + new Column( + name: 'id_recipient', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'recipient_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'log_time', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'id_notice', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'counter', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'body', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_comment', + ], + ), + new Index( + name: 'idx_id_recipient', + columns: [ + 'id_recipient', + ], + ), + new Index( + name: 'idx_log_time', + columns: [ + 'log_time', + ], + ), + new Index( + name: 'idx_comment_type', + columns: [ + 'comment_type(8)', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogDigest.php b/Sources/Db/Schema/v3_0/LogDigest.php new file mode 100644 index 00000000000..98c50e1e31c --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogDigest.php @@ -0,0 +1,88 @@ +name = 'log_digest'; + + $this->columns = [ + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'note_type', + type: 'varchar', + size: 10, + not_null: true, + default: 'post', + ), + new Column( + name: 'daily', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'exclude', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogErrors.php b/Sources/Db/Schema/v3_0/LogErrors.php new file mode 100644 index 00000000000..1aeb3ae50d1 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogErrors.php @@ -0,0 +1,151 @@ +name = 'log_errors'; + + $this->columns = [ + new Column( + name: 'id_error', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'log_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'url', + type: 'text', + not_null: true, + ), + new Column( + name: 'message', + type: 'text', + not_null: true, + ), + new Column( + name: 'session', + type: 'varchar', + size: 128, + not_null: true, + default: '', + ), + new Column( + name: 'error_type', + type: 'char', + size: 15, + not_null: true, + default: 'general', + ), + new Column( + name: 'file', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'line', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'backtrace', + type: 'varchar', + size: 10000, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_error', + ], + ), + new Index( + name: 'idx_log_time', + columns: [ + 'log_time', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_ip', + columns: [ + 'ip', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogFloodcontrol.php b/Sources/Db/Schema/v3_0/LogFloodcontrol.php new file mode 100644 index 00000000000..e5c3e7c8052 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogFloodcontrol.php @@ -0,0 +1,95 @@ +name = 'log_floodcontrol'; + + $this->columns = [ + new Column( + name: 'ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'log_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'log_type', + type: 'varchar', + size: 30, + default: 'post', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'ip', + 'log_type', + ], + ), + new Index( + type: 'primary', + columns: [ + 'id_request', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + 'id_group', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogMarkRead.php b/Sources/Db/Schema/v3_0/LogMarkRead.php new file mode 100644 index 00000000000..0f4c9b8db5b --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogMarkRead.php @@ -0,0 +1,83 @@ +name = 'log_mark_read'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_member', + 'id_board', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogMemberNotices.php b/Sources/Db/Schema/v3_0/LogMemberNotices.php new file mode 100644 index 00000000000..4417da825c7 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogMemberNotices.php @@ -0,0 +1,81 @@ +name = 'log_member_notices'; + + $this->columns = [ + new Column( + name: 'id_notice', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'subject', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'body', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_notice', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogNotify.php b/Sources/Db/Schema/v3_0/LogNotify.php new file mode 100644 index 00000000000..e807add2bd2 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogNotify.php @@ -0,0 +1,97 @@ +name = 'log_notify'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'sent', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_member', + 'id_topic', + 'id_board', + ], + ), + new Index( + name: 'idx_id_topic', + columns: [ + 'id_topic', + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogOnline.php b/Sources/Db/Schema/v3_0/LogOnline.php new file mode 100644 index 00000000000..c4f5ef496ed --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogOnline.php @@ -0,0 +1,125 @@ +name = 'log_online'; + + $this->columns = [ + new Column( + name: 'session', + type: 'varchar', + size: 128, + default: '', + ), + new Column( + name: 'log_time', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_spider', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'url', + type: 'varchar', + size: 2048, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'session', + ], + ), + new Index( + name: 'idx_log_time', + columns: [ + 'log_time', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + type: 'primary', + columns: [ + 'id_install', + ], + ), + new Index( + name: 'idx_filename', + columns: [ + 'filename(15)', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogPolls.php b/Sources/Db/Schema/v3_0/LogPolls.php new file mode 100644 index 00000000000..ea02292dc3c --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogPolls.php @@ -0,0 +1,86 @@ +name = 'log_polls'; + + $this->columns = [ + new Column( + name: 'id_poll', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_choice', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + name: 'idx_id_poll', + columns: [ + 'id_poll', + 'id_member', + 'id_choice', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogReported.php b/Sources/Db/Schema/v3_0/LogReported.php new file mode 100644 index 00000000000..3ef2e475fd4 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogReported.php @@ -0,0 +1,176 @@ +name = 'log_reported'; + + $this->columns = [ + new Column( + name: 'id_report', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'membername', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'subject', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'body', + type: 'mediumtext', + not_null: true, + ), + new Column( + name: 'time_started', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'time_updated', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'num_reports', + type: 'mediumint', + not_null: true, + default: 0, + ), + new Column( + name: 'closed', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'ignore_all', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_report', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_id_topic', + columns: [ + 'id_topic', + ], + ), + new Index( + name: 'idx_closed', + columns: [ + 'closed', + ], + ), + new Index( + name: 'idx_time_started', + columns: [ + 'time_started', + ], + ), + new Index( + name: 'idx_id_msg', + columns: [ + 'id_msg', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogReportedComments.php b/Sources/Db/Schema/v3_0/LogReportedComments.php new file mode 100644 index 00000000000..12d900d4fc8 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogReportedComments.php @@ -0,0 +1,122 @@ +name = 'log_reported_comments'; + + $this->columns = [ + new Column( + name: 'id_comment', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_report', + type: 'mediumint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + not_null: true, + ), + new Column( + name: 'membername', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'member_ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'comment', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'time_sent', + type: 'int', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_comment', + ], + ), + new Index( + name: 'idx_id_report', + columns: [ + 'id_report', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_time_sent', + columns: [ + 'time_sent', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogScheduledTasks.php b/Sources/Db/Schema/v3_0/LogScheduledTasks.php new file mode 100644 index 00000000000..3018b14dd88 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogScheduledTasks.php @@ -0,0 +1,86 @@ +name = 'log_scheduled_tasks'; + + $this->columns = [ + new Column( + name: 'id_log', + type: 'mediumint', + auto: true, + ), + new Column( + name: 'id_task', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'time_run', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'time_taken', + type: 'float', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_log', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSearchMessages.php b/Sources/Db/Schema/v3_0/LogSearchMessages.php new file mode 100644 index 00000000000..03ed956ac37 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSearchMessages.php @@ -0,0 +1,76 @@ +name = 'log_search_messages'; + + $this->columns = [ + new Column( + name: 'id_search', + type: 'tinyint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_search', + 'id_msg', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSearchResults.php b/Sources/Db/Schema/v3_0/LogSearchResults.php new file mode 100644 index 00000000000..7a89114e071 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSearchResults.php @@ -0,0 +1,97 @@ +name = 'log_search_results'; + + $this->columns = [ + new Column( + name: 'id_search', + type: 'tinyint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'relevance', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'num_matches', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_search', + 'id_topic', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSearchSubjects.php b/Sources/Db/Schema/v3_0/LogSearchSubjects.php new file mode 100644 index 00000000000..a3381b82b74 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSearchSubjects.php @@ -0,0 +1,82 @@ +name = 'log_search_subjects'; + + $this->columns = [ + new Column( + name: 'word', + type: 'varchar', + size: 20, + default: '', + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'word', + 'id_topic', + ], + ), + new Index( + name: 'idx_id_topic', + columns: [ + 'id_topic', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSearchTopics.php b/Sources/Db/Schema/v3_0/LogSearchTopics.php new file mode 100644 index 00000000000..1f1bf0a1622 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSearchTopics.php @@ -0,0 +1,76 @@ +name = 'log_search_topics'; + + $this->columns = [ + new Column( + name: 'id_search', + type: 'tinyint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_search', + 'id_topic', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSpiderHits.php b/Sources/Db/Schema/v3_0/LogSpiderHits.php new file mode 100644 index 00000000000..560a21b595e --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSpiderHits.php @@ -0,0 +1,102 @@ +name = 'log_spider_hits'; + + $this->columns = [ + new Column( + name: 'id_hit', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_spider', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'log_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'url', + type: 'varchar', + size: 1024, + not_null: true, + default: '', + ), + new Column( + name: 'processed', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_hit', + ], + ), + new Index( + name: 'idx_processed', + columns: [ + 'processed', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSpiderStats.php b/Sources/Db/Schema/v3_0/LogSpiderStats.php new file mode 100644 index 00000000000..078062365b4 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSpiderStats.php @@ -0,0 +1,88 @@ +name = 'log_spider_stats'; + + $this->columns = [ + new Column( + name: 'id_spider', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'page_hits', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'last_seen', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'stat_date', + type: 'date', + default: '1004-01-01', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'stat_date', + 'id_spider', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogSubscribed.php b/Sources/Db/Schema/v3_0/LogSubscribed.php new file mode 100644 index 00000000000..d6780c41a7e --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogSubscribed.php @@ -0,0 +1,160 @@ +name = 'log_subscribed'; + + $this->columns = [ + new Column( + name: 'id_sublog', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_subscribe', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'old_id_group', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'start_time', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'end_time', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'status', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'payments_pending', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'pending_details', + type: 'text', + not_null: true, + ), + new Column( + name: 'reminder_sent', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'vendor_ref', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_sublog', + ], + ), + new Index( + name: 'idx_end_time', + columns: [ + 'end_time', + ], + ), + new Index( + name: 'idx_reminder_sent', + columns: [ + 'reminder_sent', + ], + ), + new Index( + name: 'idx_payments_pending', + columns: [ + 'payments_pending', + ], + ), + new Index( + name: 'idx_status', + columns: [ + 'status', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/LogTopics.php b/Sources/Db/Schema/v3_0/LogTopics.php new file mode 100644 index 00000000000..054681aae84 --- /dev/null +++ b/Sources/Db/Schema/v3_0/LogTopics.php @@ -0,0 +1,95 @@ +name = 'log_topics'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'unwatched', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_member', + 'id_topic', + ], + ), + new Index( + name: 'idx_id_topic', + columns: [ + 'id_topic', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/MailQueue.php b/Sources/Db/Schema/v3_0/MailQueue.php new file mode 100644 index 00000000000..322a3ddf9ca --- /dev/null +++ b/Sources/Db/Schema/v3_0/MailQueue.php @@ -0,0 +1,130 @@ +name = 'mail_queue'; + + $this->columns = [ + new Column( + name: 'id_mail', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'time_sent', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'recipient', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'body', + type: 'mediumtext', + not_null: true, + ), + new Column( + name: 'subject', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'headers', + type: 'text', + not_null: true, + ), + new Column( + name: 'send_html', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'priority', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'private', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_mail', + ], + ), + new Index( + name: 'idx_time_sent', + columns: [ + 'time_sent', + ], + ), + new Index( + name: 'idx_mail_priority', + columns: [ + 'priority', + 'id_mail', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/MemberLogins.php b/Sources/Db/Schema/v3_0/MemberLogins.php new file mode 100644 index 00000000000..b0f5d305884 --- /dev/null +++ b/Sources/Db/Schema/v3_0/MemberLogins.php @@ -0,0 +1,102 @@ +name = 'member_logins'; + + $this->columns = [ + new Column( + name: 'id_login', + type: 'int', + auto: true, + ), + new Column( + name: 'id_member', + type: 'mediumint', + not_null: true, + default: 0, + ), + new Column( + name: 'time', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'ip2', + type: 'inet', + size: 16, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_login', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_time', + columns: [ + 'time', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Membergroups.php b/Sources/Db/Schema/v3_0/Membergroups.php new file mode 100644 index 00000000000..7841a99f6fe --- /dev/null +++ b/Sources/Db/Schema/v3_0/Membergroups.php @@ -0,0 +1,211 @@ + 1, + 'group_name' => '{$default_administrator_group}', + 'description' => '', + 'online_color' => '#FF0000', + 'min_posts' => -1, + 'icons' => '5#iconadmin.png', + 'group_type' => 1, + ], + [ + 'id_group' => 2, + 'group_name' => '{$default_global_moderator_group}', + 'description' => '', + 'online_color' => '#0000FF', + 'min_posts' => -1, + 'icons' => '5#icongmod.png', + 'group_type' => 0, + ], + [ + 'id_group' => 3, + 'group_name' => '{$default_moderator_group}', + 'description' => '', + 'online_color' => '', + 'min_posts' => -1, + 'icons' => '5#iconmod.png', + 'group_type' => 0, + ], + [ + 'id_group' => 4, + 'group_name' => '{$default_newbie_group}', + 'description' => '', + 'online_color' => '', + 'min_posts' => 0, + 'icons' => '1#icon.png', + 'group_type' => 0, + ], + [ + 'id_group' => 5, + 'group_name' => '{$default_junior_group}', + 'description' => '', + 'online_color' => '', + 'min_posts' => 50, + 'icons' => '2#icon.png', + 'group_type' => 0, + ], + [ + 'id_group' => 6, + 'group_name' => '{$default_full_group}', + 'description' => '', + 'online_color' => '', + 'min_posts' => 100, + 'icons' => '3#icon.png', + 'group_type' => 0, + ], + [ + 'id_group' => 7, + 'group_name' => '{$default_senior_group}', + 'description' => '', + 'online_color' => '', + 'min_posts' => 250, + 'icons' => '4#icon.png', + 'group_type' => 0, + ], + [ + 'id_group' => 8, + 'group_name' => '{$default_hero_group}', + 'description' => '', + 'online_color' => '', + 'min_posts' => 500, + 'icons' => '5#icon.png', + 'group_type' => 0, + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'membergroups'; + + $this->columns = [ + new Column( + name: 'id_group', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'group_name', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'description', + type: 'text', + not_null: true, + ), + new Column( + name: 'online_color', + type: 'varchar', + size: 20, + not_null: true, + default: '', + ), + new Column( + name: 'min_posts', + type: 'mediumint', + not_null: true, + default: -1, + ), + new Column( + name: 'max_messages', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'icons', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'group_type', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'hidden', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_parent', + type: 'smallint', + not_null: true, + default: -2, + ), + new Column( + name: 'tfa_required', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_group', + ], + ), + new Index( + name: 'idx_min_posts', + columns: [ + 'min_posts', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Members.php b/Sources/Db/Schema/v3_0/Members.php new file mode 100644 index 00000000000..0f66f5663ad --- /dev/null +++ b/Sources/Db/Schema/v3_0/Members.php @@ -0,0 +1,461 @@ +name = 'members'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'member_name', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'date_registered', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'posts', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_group', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'lngfile', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'last_login', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'real_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'instant_messages', + type: 'smallint', + not_null: true, + ), + new Column( + name: 'unread_messages', + type: 'smallint', + not_null: true, + ), + new Column( + name: 'new_pm', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'alerts', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'buddy_list', + type: 'text', + not_null: true, + ), + new Column( + name: 'pm_ignore_list', + type: 'text', + ), + new Column( + name: 'pm_prefs', + type: 'mediumint', + not_null: true, + default: 0, + ), + new Column( + name: 'mod_prefs', + type: 'varchar', + size: 20, + not_null: true, + default: '', + ), + new Column( + name: 'passwd', + type: 'varchar', + size: 64, + not_null: true, + default: '', + ), + new Column( + name: 'email_address', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'personal_text', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'birthdate', + type: 'date', + not_null: true, + default: '1004-01-01', + ), + new Column( + name: 'website_title', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'website_url', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'show_online', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'time_format', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'signature', + type: 'text', + not_null: true, + ), + new Column( + name: 'time_offset', + type: 'float', + not_null: true, + default: 0, + ), + new Column( + name: 'avatar', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'usertitle', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'member_ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'member_ip2', + type: 'inet', + size: 16, + ), + new Column( + name: 'secret_question', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'secret_answer', + type: 'varchar', + size: 64, + not_null: true, + default: '', + ), + new Column( + name: 'id_theme', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'is_activated', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 1, + ), + new Column( + name: 'validation_code', + type: 'varchar', + size: 10, + not_null: true, + default: '', + ), + new Column( + name: 'id_msg_last_visit', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'additional_groups', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'smiley_set', + type: 'varchar', + size: 48, + not_null: true, + default: '', + ), + new Column( + name: 'id_post_group', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'total_time_logged_in', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'password_salt', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'ignore_boards', + type: 'text', + not_null: true, + ), + new Column( + name: 'warning', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'passwd_flood', + type: 'varchar', + size: 12, + not_null: true, + default: '', + ), + new Column( + name: 'pm_receive_from', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 1, + ), + new Column( + name: 'timezone', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'tfa_secret', + type: 'varchar', + size: 24, + not_null: true, + default: '', + ), + new Column( + name: 'tfa_backup', + type: 'varchar', + size: 64, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_member_name', + columns: [ + 'member_name', + ], + ), + new Index( + name: 'idx_real_name', + columns: [ + 'real_name', + ], + ), + new Index( + name: 'idx_email_address', + columns: [ + 'email_address', + ], + ), + new Index( + name: 'idx_date_registered', + columns: [ + 'date_registered', + ], + ), + new Index( + name: 'idx_id_group', + columns: [ + 'id_group', + ], + ), + new Index( + name: 'idx_birthdate', + columns: [ + 'birthdate', + ], + ), + new Index( + name: 'idx_posts', + columns: [ + 'posts', + ], + ), + new Index( + name: 'idx_last_login', + columns: [ + 'last_login', + ], + ), + new Index( + name: 'idx_lngfile', + columns: [ + 'lngfile(30)', + ], + ), + new Index( + name: 'idx_id_post_group', + columns: [ + 'id_post_group', + ], + ), + new Index( + name: 'idx_warning', + columns: [ + 'warning', + ], + ), + new Index( + name: 'idx_total_time_logged_in', + columns: [ + 'total_time_logged_in', + ], + ), + new Index( + name: 'idx_id_theme', + columns: [ + 'id_theme', + ], + ), + new Index( + name: 'idx_active_real_name', + columns: [ + 'is_activated', + 'real_name', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Mentions.php b/Sources/Db/Schema/v3_0/Mentions.php new file mode 100644 index 00000000000..915314c78d4 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Mentions.php @@ -0,0 +1,104 @@ +name = 'mentions'; + + $this->columns = [ + new Column( + name: 'content_id', + type: 'int', + default: 0, + ), + new Column( + name: 'content_type', + type: 'varchar', + size: 10, + default: '', + ), + new Column( + name: 'id_mentioned', + type: 'int', + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + ), + new Column( + name: 'time', + type: 'int', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'content_id', + 'content_type', + 'id_mentioned', + ], + ), + new Index( + name: 'content', + columns: [ + 'content_id', + 'content_type', + ], + ), + new Index( + name: 'mentionee', + columns: [ + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/MessageIcons.php b/Sources/Db/Schema/v3_0/MessageIcons.php new file mode 100644 index 00000000000..f4b814a2b17 --- /dev/null +++ b/Sources/Db/Schema/v3_0/MessageIcons.php @@ -0,0 +1,169 @@ + 'xx', + 'title' => 'Standard', + 'icon_order' => '0', + ], + [ + 'filename' => 'thumbup', + 'title' => 'Thumb Up', + 'icon_order' => '1', + ], + [ + 'filename' => 'thumbdown', + 'title' => 'Thumb Down', + 'icon_order' => '2', + ], + [ + 'filename' => 'exclamation', + 'title' => 'Exclamation point', + 'icon_order' => '3', + ], + [ + 'filename' => 'question', + 'title' => 'Question mark', + 'icon_order' => '4', + ], + [ + 'filename' => 'lamp', + 'title' => 'Lamp', + 'icon_order' => '5', + ], + [ + 'filename' => 'smiley', + 'title' => 'Smiley', + 'icon_order' => '6', + ], + [ + 'filename' => 'angry', + 'title' => 'Angry', + 'icon_order' => '7', + ], + [ + 'filename' => 'cheesy', + 'title' => 'Cheesy', + 'icon_order' => '8', + ], + [ + 'filename' => 'grin', + 'title' => 'Grin', + 'icon_order' => '9', + ], + [ + 'filename' => 'sad', + 'title' => 'Sad', + 'icon_order' => '10', + ], + [ + 'filename' => 'wink', + 'title' => 'Wink', + 'icon_order' => '11', + ], + [ + 'filename' => 'poll', + 'title' => 'Poll', + 'icon_order' => '12', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'message_icons'; + + $this->columns = [ + new Column( + name: 'id_icon', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'title', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'filename', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'icon_order', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_icon', + ], + ), + new Index( + name: 'idx_id_board', + columns: [ + 'id_board', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Messages.php b/Sources/Db/Schema/v3_0/Messages.php new file mode 100644 index 00000000000..19805d94f9a --- /dev/null +++ b/Sources/Db/Schema/v3_0/Messages.php @@ -0,0 +1,265 @@ + 1, + 'id_msg_modified' => 1, + 'id_topic' => 1, + 'id_board' => 1, + 'poster_time' => '{$current_time}', + 'subject' => '{$default_topic_subject}', + 'poster_name' => 'Simple Machines', + 'poster_email' => 'info@simplemachines.org', + 'modified_name' => '', + 'body' => '{$default_topic_message}', + 'icon' => 'xx', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'messages'; + + $this->columns = [ + new Column( + name: 'id_msg', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'poster_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_msg_modified', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'subject', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'poster_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'poster_email', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'poster_ip', + type: 'inet', + size: 16, + ), + new Column( + name: 'smileys_enabled', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'modified_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'modified_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'modified_reason', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'body', + type: 'text', + not_null: true, + ), + new Column( + name: 'icon', + type: 'varchar', + size: 16, + not_null: true, + default: 'xx', + ), + new Column( + name: 'approved', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'likes', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_msg', + ], + ), + new Index( + name: 'idx_id_board', + type: 'unique', + columns: [ + 'id_board', + 'id_msg', + 'approved', + ], + ), + new Index( + name: 'idx_id_member', + type: 'unique', + columns: [ + 'id_member', + 'id_msg', + ], + ), + new Index( + name: 'idx_ip_index', + columns: [ + 'poster_ip', + 'id_topic', + ], + ), + new Index( + name: 'idx_participation', + columns: [ + 'id_member', + 'id_topic', + ], + ), + new Index( + name: 'idx_show_posts', + columns: [ + 'id_member', + 'id_board', + ], + ), + new Index( + name: 'idx_id_member_msg', + columns: [ + 'id_member', + 'approved', + 'id_msg', + ], + ), + new Index( + name: 'idx_current_topic', + columns: [ + 'id_topic', + 'id_msg', + 'id_member', + 'approved', + ], + ), + new Index( + name: 'idx_related_ip', + columns: [ + 'id_member', + 'poster_ip', + 'id_msg', + ], + ), + new Index( + name: 'idx_likes', + columns: [ + 'likes', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/ModeratorGroups.php b/Sources/Db/Schema/v3_0/ModeratorGroups.php new file mode 100644 index 00000000000..d2df784704a --- /dev/null +++ b/Sources/Db/Schema/v3_0/ModeratorGroups.php @@ -0,0 +1,76 @@ +name = 'moderator_groups'; + + $this->columns = [ + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_group', + type: 'smallint', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_board', + 'id_group', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Moderators.php b/Sources/Db/Schema/v3_0/Moderators.php new file mode 100644 index 00000000000..0f2e924af3c --- /dev/null +++ b/Sources/Db/Schema/v3_0/Moderators.php @@ -0,0 +1,76 @@ +name = 'moderators'; + + $this->columns = [ + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_board', + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PackageServers.php b/Sources/Db/Schema/v3_0/PackageServers.php new file mode 100644 index 00000000000..76e0c8106a1 --- /dev/null +++ b/Sources/Db/Schema/v3_0/PackageServers.php @@ -0,0 +1,105 @@ + 'Simple Machines Third-party Mod Site', + 'url' => 'https://custom.simplemachines.org/packages/mods', + 'validation_url' => 'https://custom.simplemachines.org/api.php?action=validate;version=v1;smf_version={SMF_VERSION}', + ], + [ + 'name' => 'Simple Machines Downloads Site', + 'url' => 'https://download.simplemachines.org/browse.php?api=v1;smf_version={SMF_VERSION}', + 'validation_url' => 'https://download.simplemachines.org/validate.php?api=v1;smf_version={SMF_VERSION}', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'package_servers'; + + $this->columns = [ + new Column( + name: 'id_server', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'url', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'validation_url', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'extra', + type: 'text', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_server', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PermissionProfiles.php b/Sources/Db/Schema/v3_0/PermissionProfiles.php new file mode 100644 index 00000000000..38bd3eaf776 --- /dev/null +++ b/Sources/Db/Schema/v3_0/PermissionProfiles.php @@ -0,0 +1,92 @@ + 1, + 'profile_name' => 'default', + ], + [ + 'id_profile' => 2, + 'profile_name' => 'no_polls', + ], + [ + 'id_profile' => 3, + 'profile_name' => 'reply_only', + ], + [ + 'id_profile' => 4, + 'profile_name' => 'read_only', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'permission_profiles'; + + $this->columns = [ + new Column( + name: 'id_profile', + type: 'smallint', + auto: true, + ), + new Column( + name: 'profile_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_profile', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Permissions.php b/Sources/Db/Schema/v3_0/Permissions.php new file mode 100644 index 00000000000..f183fda6fcb --- /dev/null +++ b/Sources/Db/Schema/v3_0/Permissions.php @@ -0,0 +1,286 @@ + -1, + 'permission' => 'search_posts', + ], + [ + 'id_group' => -1, + 'permission' => 'calendar_view', + ], + [ + 'id_group' => -1, + 'permission' => 'view_stats', + ], + [ + 'id_group' => 0, + 'permission' => 'view_mlist', + ], + [ + 'id_group' => 0, + 'permission' => 'search_posts', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_view', + ], + [ + 'id_group' => 0, + 'permission' => 'pm_read', + ], + [ + 'id_group' => 0, + 'permission' => 'pm_send', + ], + [ + 'id_group' => 0, + 'permission' => 'pm_draft', + ], + [ + 'id_group' => 0, + 'permission' => 'calendar_view', + ], + [ + 'id_group' => 0, + 'permission' => 'view_stats', + ], + [ + 'id_group' => 0, + 'permission' => 'who_view', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_identity_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_password_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_blurb_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_displayed_name_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_signature_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_website_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_forum_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_extra_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_remove_own', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_server_avatar', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_upload_avatar', + ], + [ + 'id_group' => 0, + 'permission' => 'profile_remote_avatar', + ], + [ + 'id_group' => 0, + 'permission' => 'send_email_to_members', + ], + [ + 'id_group' => 2, + 'permission' => 'view_mlist', + ], + [ + 'id_group' => 2, + 'permission' => 'search_posts', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_view', + ], + [ + 'id_group' => 2, + 'permission' => 'pm_read', + ], + [ + 'id_group' => 2, + 'permission' => 'pm_send', + ], + [ + 'id_group' => 2, + 'permission' => 'pm_draft', + ], + [ + 'id_group' => 2, + 'permission' => 'calendar_view', + ], + [ + 'id_group' => 2, + 'permission' => 'view_stats', + ], + [ + 'id_group' => 2, + 'permission' => 'who_view', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_identity_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_password_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_blurb_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_displayed_name_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_signature_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_website_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_forum_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_extra_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_remove_own', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_server_avatar', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_upload_avatar', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_remote_avatar', + ], + [ + 'id_group' => 2, + 'permission' => 'send_email_to_members', + ], + [ + 'id_group' => 2, + 'permission' => 'profile_title_own', + ], + [ + 'id_group' => 2, + 'permission' => 'calendar_post', + ], + [ + 'id_group' => 2, + 'permission' => 'calendar_edit_any', + ], + [ + 'id_group' => 2, + 'permission' => 'access_mod_center', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'permissions'; + + $this->columns = [ + new Column( + name: 'id_group', + type: 'smallint', + default: 0, + ), + new Column( + name: 'permission', + type: 'varchar', + size: 30, + default: '', + ), + new Column( + name: 'add_deny', + type: 'tinyint', + not_null: true, + default: 1, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_group', + 'permission', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PersonalMessages.php b/Sources/Db/Schema/v3_0/PersonalMessages.php new file mode 100644 index 00000000000..3ee0feb9cf3 --- /dev/null +++ b/Sources/Db/Schema/v3_0/PersonalMessages.php @@ -0,0 +1,135 @@ +name = 'personal_messages'; + + $this->columns = [ + new Column( + name: 'id_pm', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_pm_head', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member_from', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'deleted_by_sender', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'from_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'msgtime', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'subject', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'body', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_pm', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member_from', + 'deleted_by_sender', + ], + ), + new Index( + name: 'idx_msgtime', + columns: [ + 'msgtime', + ], + ), + new Index( + name: 'idx_id_pm_head', + columns: [ + 'id_pm_head', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PmLabeledMessages.php b/Sources/Db/Schema/v3_0/PmLabeledMessages.php new file mode 100644 index 00000000000..a8e7a51be3e --- /dev/null +++ b/Sources/Db/Schema/v3_0/PmLabeledMessages.php @@ -0,0 +1,76 @@ +name = 'pm_labeled_messages'; + + $this->columns = [ + new Column( + name: 'id_label', + type: 'int', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_pm', + type: 'int', + unsigned: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_label', + 'id_pm', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PmLabels.php b/Sources/Db/Schema/v3_0/PmLabels.php new file mode 100644 index 00000000000..c8d6da261bf --- /dev/null +++ b/Sources/Db/Schema/v3_0/PmLabels.php @@ -0,0 +1,83 @@ +name = 'pm_labels'; + + $this->columns = [ + new Column( + name: 'id_label', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'name', + type: 'varchar', + size: 30, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_label', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PmRecipients.php b/Sources/Db/Schema/v3_0/PmRecipients.php new file mode 100644 index 00000000000..63f456f85a5 --- /dev/null +++ b/Sources/Db/Schema/v3_0/PmRecipients.php @@ -0,0 +1,119 @@ +name = 'pm_recipients'; + + $this->columns = [ + new Column( + name: 'id_pm', + type: 'int', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'bcc', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'is_read', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'is_new', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'deleted', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'in_inbox', + type: 'tinyint', + not_null: true, + default: 1, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_pm', + 'id_member', + ], + ), + new Index( + name: 'idx_id_member', + type: 'unique', + columns: [ + 'id_member', + 'deleted', + 'id_pm', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PmRules.php b/Sources/Db/Schema/v3_0/PmRules.php new file mode 100644 index 00000000000..1833399b496 --- /dev/null +++ b/Sources/Db/Schema/v3_0/PmRules.php @@ -0,0 +1,118 @@ +name = 'pm_rules'; + + $this->columns = [ + new Column( + name: 'id_rule', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'rule_name', + type: 'varchar', + size: 60, + not_null: true, + ), + new Column( + name: 'criteria', + type: 'text', + not_null: true, + ), + new Column( + name: 'actions', + type: 'text', + not_null: true, + ), + new Column( + name: 'delete_pm', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'is_or', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_rule', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_delete_pm', + columns: [ + 'delete_pm', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/PollChoices.php b/Sources/Db/Schema/v3_0/PollChoices.php new file mode 100644 index 00000000000..681a21d0aea --- /dev/null +++ b/Sources/Db/Schema/v3_0/PollChoices.php @@ -0,0 +1,90 @@ +name = 'poll_choices'; + + $this->columns = [ + new Column( + name: 'id_poll', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'id_choice', + type: 'tinyint', + unsigned: true, + default: 0, + ), + new Column( + name: 'label', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'votes', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_poll', + 'id_choice', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Polls.php b/Sources/Db/Schema/v3_0/Polls.php new file mode 100644 index 00000000000..4547d338c31 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Polls.php @@ -0,0 +1,145 @@ +name = 'polls'; + + $this->columns = [ + new Column( + name: 'id_poll', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'question', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'voting_locked', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'max_votes', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 1, + ), + new Column( + name: 'expire_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'hide_results', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'change_vote', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'guest_vote', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'num_guest_voters', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'reset_poll', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'poster_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_poll', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Qanda.php b/Sources/Db/Schema/v3_0/Qanda.php new file mode 100644 index 00000000000..22d89cb9ce9 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Qanda.php @@ -0,0 +1,94 @@ +name = 'qanda'; + + $this->columns = [ + new Column( + name: 'id_question', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'lngfile', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'question', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'answers', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_question', + ], + ), + new Index( + name: 'idx_lngfile', + columns: [ + 'lngfile', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/ScheduledTasks.php b/Sources/Db/Schema/v3_0/ScheduledTasks.php new file mode 100644 index 00000000000..a57c56b2582 --- /dev/null +++ b/Sources/Db/Schema/v3_0/ScheduledTasks.php @@ -0,0 +1,243 @@ + 3, + 'next_time' => 0, + 'time_offset' => 60, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 0, + 'task' => 'daily_maintenance', + 'callable' => '', + ], + [ + 'id_task' => 5, + 'next_time' => 0, + 'time_offset' => 0, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 0, + 'task' => 'daily_digest', + 'callable' => '', + ], + [ + 'id_task' => 6, + 'next_time' => 0, + 'time_offset' => 0, + 'time_regularity' => 1, + 'time_unit' => 'w', + 'disabled' => 0, + 'task' => 'weekly_digest', + 'callable' => '', + ], + [ + 'id_task' => 7, + 'next_time' => 0, + 'time_offset' => '{$sched_task_offset}', + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 0, + 'task' => 'fetchSMfiles', + 'callable' => '', + ], + [ + 'id_task' => 8, + 'next_time' => 0, + 'time_offset' => 0, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 1, + 'task' => 'birthdayemails', + 'callable' => '', + ], + [ + 'id_task' => 9, + 'next_time' => 0, + 'time_offset' => 0, + 'time_regularity' => 1, + 'time_unit' => 'w', + 'disabled' => 0, + 'task' => 'weekly_maintenance', + 'callable' => '', + ], + [ + 'id_task' => 10, + 'next_time' => 0, + 'time_offset' => 120, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 1, + 'task' => 'paid_subscriptions', + 'callable' => '', + ], + [ + 'id_task' => 11, + 'next_time' => 0, + 'time_offset' => 120, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 0, + 'task' => 'remove_temp_attachments', + 'callable' => '', + ], + [ + 'id_task' => 12, + 'next_time' => 0, + 'time_offset' => 180, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 0, + 'task' => 'remove_topic_redirect', + 'callable' => '', + ], + [ + 'id_task' => 13, + 'next_time' => 0, + 'time_offset' => 240, + 'time_regularity' => 1, + 'time_unit' => 'd', + 'disabled' => 0, + 'task' => 'remove_old_drafts', + 'callable' => '', + ], + [ + 'id_task' => 14, + 'next_time' => 0, + 'time_offset' => 0, + 'time_regularity' => 1, + 'time_unit' => 'w', + 'disabled' => 1, + 'task' => 'prune_log_topics', + 'callable' => '', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'scheduled_tasks'; + + $this->columns = [ + new Column( + name: 'id_task', + type: 'smallint', + auto: true, + ), + new Column( + name: 'next_time', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'time_offset', + type: 'int', + not_null: true, + default: 0, + ), + new Column( + name: 'time_regularity', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'time_unit', + type: 'varchar', + size: 1, + not_null: true, + default: 'h', + ), + new Column( + name: 'disabled', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'task', + type: 'varchar', + size: 24, + not_null: true, + default: '', + ), + new Column( + name: 'callable', + type: 'varchar', + size: 60, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_task', + ], + ), + new Index( + name: 'idx_next_time', + columns: [ + 'next_time', + ], + ), + new Index( + name: 'idx_disabled', + columns: [ + 'disabled', + ], + ), + new Index( + name: 'idx_task', + type: 'unique', + columns: [ + 'task', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Sessions.php b/Sources/Db/Schema/v3_0/Sessions.php new file mode 100644 index 00000000000..9ad547e79ef --- /dev/null +++ b/Sources/Db/Schema/v3_0/Sessions.php @@ -0,0 +1,82 @@ +name = 'sessions'; + + $this->columns = [ + new Column( + name: 'session_id', + type: 'varchar', + size: 128, + not_null: true, + default: '', + ), + new Column( + name: 'last_update', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'data', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'session_id', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Settings.php b/Sources/Db/Schema/v3_0/Settings.php new file mode 100644 index 00000000000..1e31089162a --- /dev/null +++ b/Sources/Db/Schema/v3_0/Settings.php @@ -0,0 +1,891 @@ + 'additional_options_collapsable', + 'value' => '1', + ], + [ + 'variable' => 'adminlog_enabled', + 'value' => '1', + ], + [ + 'variable' => 'alerts_auto_purge', + 'value' => '30', + ], + [ + 'variable' => 'allow_editDisplayName', + 'value' => '1', + ], + [ + 'variable' => 'allow_expire_redirect', + 'value' => '1', + ], + [ + 'variable' => 'allow_guestAccess', + 'value' => '1', + ], + [ + 'variable' => 'allow_hideOnline', + 'value' => '1', + ], + [ + 'variable' => 'attachmentCheckExtensions', + 'value' => '0', + ], + [ + 'variable' => 'attachmentDirFileLimit', + 'value' => '1000', + ], + [ + 'variable' => 'attachmentDirSizeLimit', + 'value' => '10240', + ], + [ + 'variable' => 'attachmentEnable', + 'value' => '1', + ], + [ + 'variable' => 'attachmentExtensions', + 'value' => 'doc,gif,jpg,mpg,pdf,png,txt,zip', + ], + [ + 'variable' => 'attachmentNumPerPostLimit', + 'value' => '4', + ], + [ + 'variable' => 'attachmentPostLimit', + 'value' => '192', + ], + [ + 'variable' => 'attachmentShowImages', + 'value' => '1', + ], + [ + 'variable' => 'attachmentSizeLimit', + 'value' => '128', + ], + [ + 'variable' => 'attachmentThumbHeight', + 'value' => '150', + ], + [ + 'variable' => 'attachmentThumbWidth', + 'value' => '150', + ], + [ + 'variable' => 'attachmentThumbnails', + 'value' => '1', + ], + [ + 'variable' => 'attachmentUploadDir', + 'value' => '{$attachdir}', + ], + [ + 'variable' => 'attachment_image_paranoid', + 'value' => '0', + ], + [ + 'variable' => 'attachment_image_reencode', + 'value' => '1', + ], + [ + 'variable' => 'attachment_thumb_png', + 'value' => '1', + ], + [ + 'variable' => 'attachments_21_done', + 'value' => '1', + ], + [ + 'variable' => 'autoFixDatabase', + 'value' => '1', + ], + [ + 'variable' => 'autoLinkUrls', + 'value' => '1', + ], + [ + 'variable' => 'avatar_action_too_large', + 'value' => 'option_css_resize', + ], + [ + 'variable' => 'avatar_directory', + 'value' => '{$boarddir}/avatars', + ], + [ + 'variable' => 'avatar_download_png', + 'value' => '1', + ], + [ + 'variable' => 'avatar_max_height_external', + 'value' => '65', + ], + [ + 'variable' => 'avatar_max_height_upload', + 'value' => '65', + ], + [ + 'variable' => 'avatar_max_width_external', + 'value' => '65', + ], + [ + 'variable' => 'avatar_max_width_upload', + 'value' => '65', + ], + [ + 'variable' => 'avatar_paranoid', + 'value' => '0', + ], + [ + 'variable' => 'avatar_reencode', + 'value' => '1', + ], + [ + 'variable' => 'avatar_resize_upload', + 'value' => '1', + ], + [ + 'variable' => 'avatar_url', + 'value' => '{$boardurl}/avatars', + ], + [ + 'variable' => 'banLastUpdated', + 'value' => '0', + ], + [ + 'variable' => 'birthday_email', + 'value' => 'happy_birthday', + ], + [ + 'variable' => 'boardindex_max_depth', + 'value' => '5', + ], + [ + 'variable' => 'cal_days_for_index', + 'value' => '7', + ], + [ + 'variable' => 'cal_daysaslink', + 'value' => '0', + ], + [ + 'variable' => 'cal_defaultboard', + 'value' => '', + ], + [ + 'variable' => 'cal_disable_prev_next', + 'value' => '0', + ], + [ + 'variable' => 'cal_display_type', + 'value' => '0', + ], + [ + 'variable' => 'cal_enabled', + 'value' => '0', + ], + [ + 'variable' => 'cal_maxspan', + 'value' => '0', + ], + [ + 'variable' => 'cal_maxyear', + 'value' => '2030', + ], + [ + 'variable' => 'cal_minyear', + 'value' => '2008', + ], + [ + 'variable' => 'cal_prev_next_links', + 'value' => '1', + ], + [ + 'variable' => 'cal_short_days', + 'value' => '0', + ], + [ + 'variable' => 'cal_short_months', + 'value' => '0', + ], + [ + 'variable' => 'cal_showInTopic', + 'value' => '1', + ], + [ + 'variable' => 'cal_showbdays', + 'value' => '1', + ], + [ + 'variable' => 'cal_showevents', + 'value' => '1', + ], + [ + 'variable' => 'cal_showholidays', + 'value' => '1', + ], + [ + 'variable' => 'cal_week_links', + 'value' => '2', + ], + [ + 'variable' => 'censorIgnoreCase', + 'value' => '1', + ], + [ + 'variable' => 'censor_proper', + 'value' => '', + ], + [ + 'variable' => 'censor_vulgar', + 'value' => '', + ], + [ + 'variable' => 'compactTopicPagesContiguous', + 'value' => '5', + ], + [ + 'variable' => 'compactTopicPagesEnable', + 'value' => '1', + ], + [ + 'variable' => 'cookieTime', + 'value' => '3153600', + ], + [ + 'variable' => 'currentAttachmentUploadDir', + 'value' => 1, + ], + [ + 'variable' => 'custom_avatar_dir', + 'value' => '{$boarddir}/custom_avatar', + ], + [ + 'variable' => 'custom_avatar_url', + 'value' => '{$boardurl}/custom_avatar', + ], + [ + 'variable' => 'databaseSession_enable', + 'value' => '{$databaseSession_enable}', + ], + [ + 'variable' => 'databaseSession_lifetime', + 'value' => '2880', + ], + [ + 'variable' => 'databaseSession_loose', + 'value' => '1', + ], + [ + 'variable' => 'defaultMaxListItems', + 'value' => '15', + ], + [ + 'variable' => 'defaultMaxMembers', + 'value' => '30', + ], + [ + 'variable' => 'defaultMaxMessages', + 'value' => '15', + ], + [ + 'variable' => 'defaultMaxTopics', + 'value' => '20', + ], + [ + 'variable' => 'default_personal_text', + 'value' => '', + ], + [ + 'variable' => 'displayFields', + 'value' => '[{"col_name":"cust_icq","title":"ICQ","type":"text","order":"1","bbc":"0","placement":"1","enclose":"\\"ICQ<\\/a>","mlist":"0"},{"col_name":"cust_skype","title":"Skype","type":"text","order":"2","bbc":"0","placement":"1","enclose":"\\"{INPUT}\\"<\\/a> ","mlist":"0"},{"col_name":"cust_loca","title":"Location","type":"text","order":"4","bbc":"0","placement":"0","enclose":"","mlist":"0"},{"col_name":"cust_gender","title":"Gender","type":"radio","order":"5","bbc":"0","placement":"1","enclose":"<\\/span>","mlist":"0","options":["None","Male","Female"]}]', + ], + [ + 'variable' => 'dont_repeat_buddylists', + 'value' => '1', + ], + [ + 'variable' => 'dont_repeat_smileys_20', + 'value' => '1', + ], + [ + 'variable' => 'dont_repeat_theme_core', + 'value' => '1', + ], + [ + 'variable' => 'drafts_autosave_enabled', + 'value' => '1', + ], + [ + 'variable' => 'drafts_keep_days', + 'value' => '7', + ], + [ + 'variable' => 'drafts_pm_enabled', + 'value' => '1', + ], + [ + 'variable' => 'drafts_post_enabled', + 'value' => '1', + ], + [ + 'variable' => 'drafts_show_saved_enabled', + 'value' => '1', + ], + [ + 'variable' => 'edit_disable_time', + 'value' => '0', + ], + [ + 'variable' => 'edit_wait_time', + 'value' => '90', + ], + [ + 'variable' => 'enableAllMessages', + 'value' => '0', + ], + [ + 'variable' => 'enableBBC', + 'value' => '1', + ], + [ + 'variable' => 'enableCompressedOutput', + 'value' => '{$enableCompressedOutput}', + ], + [ + 'variable' => 'enableErrorLogging', + 'value' => '1', + ], + [ + 'variable' => 'enableParticipation', + 'value' => '1', + ], + [ + 'variable' => 'enablePostHTML', + 'value' => '0', + ], + [ + 'variable' => 'enablePreviousNext', + 'value' => '1', + ], + [ + 'variable' => 'enableThemes', + 'value' => '1', + ], + [ + 'variable' => 'enable_ajax_alerts', + 'value' => '1', + ], + [ + 'variable' => 'enable_buddylist', + 'value' => '1', + ], + [ + 'variable' => 'export_dir', + 'value' => '{$boarddir}/exports', + ], + [ + 'variable' => 'export_expiry', + 'value' => '7', + ], + [ + 'variable' => 'export_min_diskspace_pct', + 'value' => '5', + ], + [ + 'variable' => 'export_rate', + 'value' => '250', + ], + [ + 'variable' => 'failed_login_threshold', + 'value' => '3', + ], + [ + 'variable' => 'gravatarAllowExtraEmail', + 'value' => '1', + ], + [ + 'variable' => 'gravatarEnabled', + 'value' => '1', + ], + [ + 'variable' => 'gravatarMaxRating', + 'value' => 'PG', + ], + [ + 'variable' => 'gravatarOverride', + 'value' => '0', + ], + [ + 'variable' => 'httponlyCookies', + 'value' => '1', + ], + [ + 'variable' => 'json_done', + 'value' => '1', + ], + [ + 'variable' => 'knownThemes', + 'value' => '1', + ], + [ + 'variable' => 'lastActive', + 'value' => '15', + ], + [ + 'variable' => 'last_mod_report_action', + 'value' => '0', + ], + [ + 'variable' => 'loginHistoryDays', + 'value' => '30', + ], + [ + 'variable' => 'mail_limit', + 'value' => '5', + ], + [ + 'variable' => 'mail_next_send', + 'value' => '0', + ], + [ + 'variable' => 'mail_quantity', + 'value' => '5', + ], + [ + 'variable' => 'mail_recent', + 'value' => '0000000000|0', + ], + [ + 'variable' => 'mail_type', + 'value' => '0', + ], + [ + 'variable' => 'mark_read_beyond', + 'value' => '90', + ], + [ + 'variable' => 'mark_read_delete_beyond', + 'value' => '365', + ], + [ + 'variable' => 'mark_read_max_users', + 'value' => '500', + ], + [ + 'variable' => 'maxMsgID', + 'value' => '1', + ], + [ + 'variable' => 'max_image_height', + 'value' => '0', + ], + [ + 'variable' => 'max_image_width', + 'value' => '0', + ], + [ + 'variable' => 'max_messageLength', + 'value' => '20000', + ], + [ + 'variable' => 'minimize_files', + 'value' => '1', + ], + [ + 'variable' => 'modlog_enabled', + 'value' => '1', + ], + [ + 'variable' => 'mostDate', + 'value' => '{$current_time}', + ], + [ + 'variable' => 'mostOnline', + 'value' => '1', + ], + [ + 'variable' => 'mostOnlineToday', + 'value' => '1', + ], + [ + 'variable' => 'news', + 'value' => '{$default_news}', + ], + [ + 'variable' => 'next_task_time', + 'value' => '1', + ], + [ + 'variable' => 'number_format', + 'value' => '1234.00', + ], + [ + 'variable' => 'oldTopicDays', + 'value' => '120', + ], + [ + 'variable' => 'onlineEnable', + 'value' => '0', + ], + [ + 'variable' => 'package_make_backups', + 'value' => '1', + ], + [ + 'variable' => 'permission_enable_deny', + 'value' => '0', + ], + [ + 'variable' => 'permission_enable_postgroups', + 'value' => '0', + ], + [ + 'variable' => 'pm_spam_settings', + 'value' => '10,5,20', + ], + [ + 'variable' => 'pollMode', + 'value' => '1', + ], + [ + 'variable' => 'pruningOptions', + 'value' => '30,180,180,180,30,0', + ], + [ + 'variable' => 'recycle_board', + 'value' => '0', + ], + [ + 'variable' => 'recycle_enable', + 'value' => '0', + ], + [ + 'variable' => 'reg_verification', + 'value' => '1', + ], + [ + 'variable' => 'registration_method', + 'value' => '{$registration_method}', + ], + [ + 'variable' => 'requireAgreement', + 'value' => '1', + ], + [ + 'variable' => 'requirePolicyAgreement', + 'value' => '0', + ], + [ + 'variable' => 'reserveCase', + 'value' => '1', + ], + [ + 'variable' => 'reserveName', + 'value' => '1', + ], + [ + 'variable' => 'reserveNames', + 'value' => '{$default_reserved_names}', + ], + [ + 'variable' => 'reserveUser', + 'value' => '1', + ], + [ + 'variable' => 'reserveWord', + 'value' => '0', + ], + [ + 'variable' => 'samesiteCookies', + 'value' => 'lax', + ], + [ + 'variable' => 'search_cache_size', + 'value' => '50', + ], + [ + 'variable' => 'search_floodcontrol_time', + 'value' => '5', + ], + [ + 'variable' => 'search_max_results', + 'value' => '1200', + ], + [ + 'variable' => 'search_results_per_page', + 'value' => '30', + ], + [ + 'variable' => 'search_weight_age', + 'value' => '25', + ], + [ + 'variable' => 'search_weight_first_message', + 'value' => '10', + ], + [ + 'variable' => 'search_weight_frequency', + 'value' => '30', + ], + [ + 'variable' => 'search_weight_length', + 'value' => '20', + ], + [ + 'variable' => 'search_weight_subject', + 'value' => '15', + ], + [ + 'variable' => 'securityDisable_moderate', + 'value' => '1', + ], + [ + 'variable' => 'send_validation_onChange', + 'value' => '0', + ], + [ + 'variable' => 'send_welcomeEmail', + 'value' => '1', + ], + [ + 'variable' => 'settings_updated', + 'value' => '0', + ], + [ + 'variable' => 'show_blurb', + 'value' => '1', + ], + [ + 'variable' => 'show_modify', + 'value' => '1', + ], + [ + 'variable' => 'show_profile_buttons', + 'value' => '1', + ], + [ + 'variable' => 'show_user_images', + 'value' => '1', + ], + [ + 'variable' => 'signature_settings', + 'value' => '1,300,0,0,0,0,0,0:', + ], + [ + 'variable' => 'smfVersion', + 'value' => '{$smf_version}', + ], + [ + 'variable' => 'smiley_sets_default', + 'value' => 'fugue', + ], + [ + 'variable' => 'smiley_sets_known', + 'value' => 'fugue,alienine', + ], + [ + 'variable' => 'smiley_sets_names', + 'value' => '{$default_fugue_smileyset_name}\n{$default_alienine_smileyset_name}', + ], + [ + 'variable' => 'smileys_dir', + 'value' => '{$boarddir}/Smileys', + ], + [ + 'variable' => 'smileys_url', + 'value' => '{$boardurl}/Smileys', + ], + [ + 'variable' => 'smtp_host', + 'value' => '', + ], + [ + 'variable' => 'smtp_password', + 'value' => '', + ], + [ + 'variable' => 'smtp_port', + 'value' => '25', + ], + [ + 'variable' => 'smtp_username', + 'value' => '', + ], + [ + 'variable' => 'spamWaitTime', + 'value' => '5', + ], + [ + 'variable' => 'tfa_mode', + 'value' => '1', + ], + [ + 'variable' => 'theme_allow', + 'value' => '1', + ], + [ + 'variable' => 'theme_default', + 'value' => '1', + ], + [ + 'variable' => 'theme_guests', + 'value' => '1', + ], + [ + 'variable' => 'timeLoadPageEnable', + 'value' => '0', + ], + [ + 'variable' => 'time_format', + 'value' => '{$default_time_format}', + ], + [ + 'variable' => 'titlesEnable', + 'value' => '1', + ], + [ + 'variable' => 'todayMod', + 'value' => '1', + ], + [ + 'variable' => 'topicSummaryPosts', + 'value' => '15', + ], + [ + 'variable' => 'topic_move_any', + 'value' => '0', + ], + [ + 'variable' => 'totalMembers', + 'value' => '0', + ], + [ + 'variable' => 'totalMessages', + 'value' => '1', + ], + [ + 'variable' => 'totalTopics', + 'value' => '1', + ], + [ + 'variable' => 'trackStats', + 'value' => '1', + ], + [ + 'variable' => 'unapprovedMembers', + 'value' => '0', + ], + [ + 'variable' => 'use_subdirectories_for_attachments', + 'value' => '1', + ], + [ + 'variable' => 'userLanguage', + 'value' => '1', + ], + [ + 'variable' => 'visual_verification_type', + 'value' => '3', + ], + [ + 'variable' => 'warning_moderate', + 'value' => '35', + ], + [ + 'variable' => 'warning_mute', + 'value' => '60', + ], + [ + 'variable' => 'warning_settings', + 'value' => '1,20,0', + ], + [ + 'variable' => 'warning_watch', + 'value' => '10', + ], + [ + 'variable' => 'who_enabled', + 'value' => '1', + ], + [ + 'variable' => 'xmlnews_enable', + 'value' => '1', + ], + [ + 'variable' => 'xmlnews_maxlen', + 'value' => '255', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'settings'; + + $this->columns = [ + new Column( + name: 'variable', + type: 'varchar', + size: 255, + default: '', + ), + new Column( + name: 'value', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'variable(30)', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/SmileyFiles.php b/Sources/Db/Schema/v3_0/SmileyFiles.php new file mode 100644 index 00000000000..bd6fb066091 --- /dev/null +++ b/Sources/Db/Schema/v3_0/SmileyFiles.php @@ -0,0 +1,84 @@ +name = 'smiley_files'; + + $this->columns = [ + new Column( + name: 'id_smiley', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'smiley_set', + type: 'varchar', + size: 48, + not_null: true, + default: '', + ), + new Column( + name: 'filename', + type: 'varchar', + size: 48, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_smiley', + 'smiley_set', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Smileys.php b/Sources/Db/Schema/v3_0/Smileys.php new file mode 100644 index 00000000000..a9e6b31b110 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Smileys.php @@ -0,0 +1,104 @@ +name = 'smileys'; + + $this->columns = [ + new Column( + name: 'id_smiley', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'code', + type: 'varchar', + size: 30, + not_null: true, + default: '', + ), + new Column( + name: 'description', + type: 'varchar', + size: 80, + not_null: true, + default: '', + ), + new Column( + name: 'smiley_row', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'smiley_order', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'hidden', + type: 'tinyint', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_smiley', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Spiders.php b/Sources/Db/Schema/v3_0/Spiders.php new file mode 100644 index 00000000000..d87dcdbf6c8 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Spiders.php @@ -0,0 +1,191 @@ + 'Google', + 'user_agent' => 'googlebot', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Yahoo!', + 'user_agent' => 'slurp', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Bing', + 'user_agent' => 'bingbot', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Google (Mobile)', + 'user_agent' => 'Googlebot-Mobile', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Google (Image)', + 'user_agent' => 'Googlebot-Image', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Google (AdSense)', + 'user_agent' => 'Mediapartners-Google', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Google (Adwords)', + 'user_agent' => 'AdsBot-Google', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Yahoo! (Mobile)', + 'user_agent' => 'YahooSeeker/M1A1-R2D2', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Yahoo! (Image)', + 'user_agent' => 'Yahoo-MMCrawler', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Bing (Preview)', + 'user_agent' => 'BingPreview', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Bing (Ads)', + 'user_agent' => 'adidxbot', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Bing (MSNBot)', + 'user_agent' => 'msnbot', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Bing (Media)', + 'user_agent' => 'msnbot-media', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Cuil', + 'user_agent' => 'twiceler', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Ask', + 'user_agent' => 'Teoma', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Baidu', + 'user_agent' => 'Baiduspider', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Gigablast', + 'user_agent' => 'Gigabot', + 'ip_info' => '', + ], + [ + 'spider_name' => 'InternetArchive', + 'user_agent' => 'ia_archiver-web.archive.org', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Alexa', + 'user_agent' => 'ia_archiver', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Omgili', + 'user_agent' => 'omgilibot', + 'ip_info' => '', + ], + [ + 'spider_name' => 'EntireWeb', + 'user_agent' => 'Speedy Spider', + 'ip_info' => '', + ], + [ + 'spider_name' => 'Yandex', + 'user_agent' => 'yandex', + 'ip_info' => '', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'spiders'; + + $this->columns = [ + new Column( + name: 'id_spider', + type: 'smallint', + unsigned: true, + auto: true, + ), + new Column( + name: 'spider_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'user_agent', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'ip_info', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Subscriptions.php b/Sources/Db/Schema/v3_0/Subscriptions.php new file mode 100644 index 00000000000..555825fe879 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Subscriptions.php @@ -0,0 +1,143 @@ +name = 'subscriptions'; + + $this->columns = [ + new Column( + name: 'id_subscribe', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'name', + type: 'varchar', + size: 60, + not_null: true, + default: '', + ), + new Column( + name: 'description', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'cost', + type: 'text', + not_null: true, + ), + new Column( + name: 'length', + type: 'varchar', + size: 6, + not_null: true, + default: '', + ), + new Column( + name: 'id_group', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'add_groups', + type: 'varchar', + size: 40, + not_null: true, + default: '', + ), + new Column( + name: 'active', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'repeatable', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'allow_partial', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'reminder', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'email_complete', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_subscribe', + ], + ), + new Index( + name: 'idx_active', + columns: [ + 'active', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Themes.php b/Sources/Db/Schema/v3_0/Themes.php new file mode 100644 index 00000000000..77ece018f76 --- /dev/null +++ b/Sources/Db/Schema/v3_0/Themes.php @@ -0,0 +1,149 @@ + 1, + 'variable' => 'name', + 'value' => '{$default_theme_name}', + ], + [ + 'id_theme' => 1, + 'variable' => 'theme_url', + 'value' => '{$boardurl}/Themes/default', + ], + [ + 'id_theme' => 1, + 'variable' => 'images_url', + 'value' => '{$boardurl}/Themes/default/images', + ], + [ + 'id_theme' => 1, + 'variable' => 'theme_dir', + 'value' => '{$boarddir}/Themes/default', + ], + [ + 'id_theme' => 1, + 'variable' => 'show_latest_member', + 'value' => '1', + ], + [ + 'id_theme' => 1, + 'variable' => 'show_newsfader', + 'value' => '0', + ], + [ + 'id_theme' => 1, + 'variable' => 'number_recent_posts', + 'value' => '0', + ], + [ + 'id_theme' => 1, + 'variable' => 'show_stats_index', + 'value' => '1', + ], + [ + 'id_theme' => 1, + 'variable' => 'newsfader_time', + 'value' => '3000', + ], + [ + 'id_theme' => 1, + 'variable' => 'use_image_buttons', + 'value' => '1', + ], + [ + 'id_theme' => 1, + 'variable' => 'enable_news', + 'value' => '1', + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'themes'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + default: 0, + ), + new Column( + name: 'id_theme', + type: 'tinyint', + unsigned: true, + default: 1, + ), + new Column( + name: 'variable', + type: 'varchar', + size: 255, + default: '', + ), + new Column( + name: 'value', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_theme', + 'id_member', + 'variable(30)', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/Topics.php b/Sources/Db/Schema/v3_0/Topics.php new file mode 100644 index 00000000000..e3c8218cb0d --- /dev/null +++ b/Sources/Db/Schema/v3_0/Topics.php @@ -0,0 +1,242 @@ + 1, + 'id_board' => 1, + 'id_first_msg' => 1, + 'id_last_msg' => 1, + 'id_member_started' => 0, + 'id_member_updated' => 0, + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'topics'; + + $this->columns = [ + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + auto: true, + ), + new Column( + name: 'is_sticky', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_first_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_last_msg', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member_started', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member_updated', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_poll', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_previous_board', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'id_previous_topic', + type: 'mediumint', + not_null: true, + default: 0, + ), + new Column( + name: 'num_replies', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'num_views', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'locked', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'redirect_expires', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_redirect_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'unapproved_posts', + type: 'smallint', + not_null: true, + default: 0, + ), + new Column( + name: 'approved', + type: 'tinyint', + not_null: true, + default: 1, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_topic', + ], + ), + new Index( + name: 'idx_last_message', + type: 'unique', + columns: [ + 'id_last_msg', + 'id_board', + ], + ), + new Index( + name: 'idx_first_message', + type: 'unique', + columns: [ + 'id_first_msg', + 'id_board', + ], + ), + new Index( + name: 'idx_poll', + type: 'unique', + columns: [ + 'id_poll', + 'id_topic', + ], + ), + new Index( + name: 'idx_is_sticky', + columns: [ + 'is_sticky', + ], + ), + new Index( + name: 'idx_approved', + columns: [ + 'approved', + ], + ), + new Index( + name: 'idx_member_started', + columns: [ + 'id_member_started', + 'id_board', + ], + ), + new Index( + name: 'idx_last_message_sticky', + columns: [ + 'id_board', + 'is_sticky', + 'id_last_msg', + ], + ), + new Index( + name: 'idx_board_news', + columns: [ + 'id_board', + 'id_first_msg', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/UserAlerts.php b/Sources/Db/Schema/v3_0/UserAlerts.php new file mode 100644 index 00000000000..b2bfceed43c --- /dev/null +++ b/Sources/Db/Schema/v3_0/UserAlerts.php @@ -0,0 +1,142 @@ +name = 'user_alerts'; + + $this->columns = [ + new Column( + name: 'id_alert', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'alert_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member_started', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'member_name', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'content_type', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'content_id', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'content_action', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'is_read', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'extra', + type: 'text', + not_null: true, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_alert', + ], + ), + new Index( + name: 'idx_id_member', + columns: [ + 'id_member', + ], + ), + new Index( + name: 'idx_alert_time', + columns: [ + 'alert_time', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/UserAlertsPrefs.php b/Sources/Db/Schema/v3_0/UserAlertsPrefs.php new file mode 100644 index 00000000000..8695260224a --- /dev/null +++ b/Sources/Db/Schema/v3_0/UserAlertsPrefs.php @@ -0,0 +1,228 @@ + 0, + 'alert_pref' => 'alert_timeout', + 'alert_value' => 10, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'announcements', + 'alert_value' => 0, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'birthday', + 'alert_value' => 2, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'board_notify', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'buddy_request', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'groupr_approved', + 'alert_value' => 3, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'groupr_rejected', + 'alert_value' => 3, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'member_group_request', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'member_register', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'member_report', + 'alert_value' => 3, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'member_report_reply', + 'alert_value' => 3, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_auto_notify', + 'alert_value' => 0, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_like', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_mention', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_notify_pref', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_notify_type', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_quote', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_receive_body', + 'alert_value' => 0, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_report', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'msg_report_reply', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'pm_new', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'pm_notify', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'pm_reply', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'request_group', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'topic_notify', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'unapproved_attachment', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'unapproved_reply', + 'alert_value' => 3, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'unapproved_post', + 'alert_value' => 1, + ], + [ + 'id_member' => 0, + 'alert_pref' => 'warn_any', + 'alert_value' => 1, + ], + ]; + + /**************** + * Public methods + ****************/ + + /** + * Constructor. + */ + public function __construct() + { + $this->name = 'user_alerts_prefs'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'alert_pref', + type: 'varchar', + size: 32, + default: '', + ), + new Column( + name: 'alert_value', + type: 'tinyint', + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_member', + 'alert_pref', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/UserDrafts.php b/Sources/Db/Schema/v3_0/UserDrafts.php new file mode 100644 index 00000000000..d92ee23f25d --- /dev/null +++ b/Sources/Db/Schema/v3_0/UserDrafts.php @@ -0,0 +1,163 @@ +name = 'user_drafts'; + + $this->columns = [ + new Column( + name: 'id_draft', + type: 'int', + unsigned: true, + auto: true, + ), + new Column( + name: 'id_topic', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_board', + type: 'smallint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_reply', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'type', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'poster_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + not_null: true, + default: 0, + ), + new Column( + name: 'subject', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + new Column( + name: 'smileys_enabled', + type: 'tinyint', + not_null: true, + default: 1, + ), + new Column( + name: 'body', + type: 'mediumtext', + not_null: true, + ), + new Column( + name: 'icon', + type: 'varchar', + size: 16, + not_null: true, + default: 'xx', + ), + new Column( + name: 'locked', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'is_sticky', + type: 'tinyint', + not_null: true, + default: 0, + ), + new Column( + name: 'to_list', + type: 'varchar', + size: 255, + not_null: true, + default: '', + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'id_draft', + ], + ), + new Index( + name: 'idx_id_member', + type: 'unique', + columns: [ + 'id_member', + 'id_draft', + 'type', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/Sources/Db/Schema/v3_0/UserLikes.php b/Sources/Db/Schema/v3_0/UserLikes.php new file mode 100644 index 00000000000..1257485ffd8 --- /dev/null +++ b/Sources/Db/Schema/v3_0/UserLikes.php @@ -0,0 +1,103 @@ +name = 'user_likes'; + + $this->columns = [ + new Column( + name: 'id_member', + type: 'mediumint', + unsigned: true, + default: 0, + ), + new Column( + name: 'content_type', + type: 'char', + size: 6, + default: '', + ), + new Column( + name: 'content_id', + type: 'int', + unsigned: true, + default: 0, + ), + new Column( + name: 'like_time', + type: 'int', + unsigned: true, + not_null: true, + default: 0, + ), + ]; + + $this->indices = [ + new Index( + type: 'primary', + columns: [ + 'content_id', + 'content_type', + 'id_member', + ], + ), + new Index( + name: 'content', + columns: [ + 'content_id', + 'content_type', + ], + ), + new Index( + name: 'liker', + columns: [ + 'id_member', + ], + ), + ]; + } +} + +?> \ No newline at end of file diff --git a/other/install_3-0_MySQL.sql b/other/install_3-0_MySQL.sql index fca8f7057e9..e5641ba27e0 100644 --- a/other/install_3-0_MySQL.sql +++ b/other/install_3-0_MySQL.sql @@ -1563,7 +1563,9 @@ VALUES (1, 1, 1, 1, 1, '{$default_board_name}', '{$default_board_description}', INSERT INTO {$db_prefix}board_permissions_view (id_group, id_board, deny) -VALUES (-1,1,0), (0,1,0), (2,1,0); +VALUES (-1, 1, 0), + (0, 1, 0), + (2, 1, 0); # -------------------------------------------------------- # @@ -1785,6 +1787,7 @@ VALUES ('Independence Day', '1004-07-04'), # INSERT INTO {$db_prefix}categories + (id_cat, cat_order, name, description, can_collapse) VALUES (1, 0, '{$default_category_name}', '', 1); # -------------------------------------------------------- @@ -1864,7 +1867,10 @@ VALUES ('Simple Machines Third-party Mod Site', 'https://custom.simplemachines.o INSERT INTO {$db_prefix}permission_profiles (id_profile, profile_name) -VALUES (1, 'default'), (2, 'no_polls'), (3, 'reply_only'), (4, 'read_only'); +VALUES (1, 'default'), + (2, 'no_polls'), + (3, 'reply_only'), + (4, 'read_only'); # -------------------------------------------------------- #