From fd97a09f92dd72e86589e5861a2e2ea7a892cb96 Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Fri, 1 Mar 2024 23:54:35 -0700 Subject: [PATCH] Removes $initial_columns property in SMF\Db\Schema\Table Signed-off-by: Jon Stovell --- Sources/Db/Schema/Column.php | 6 +++- Sources/Db/Schema/Table.php | 7 ----- Sources/Db/Schema/v3_0/AdminInfoFiles.php | 14 --------- Sources/Db/Schema/v3_0/ApprovalQueue.php | 7 ----- Sources/Db/Schema/v3_0/Attachments.php | 7 ----- Sources/Db/Schema/v3_0/BackgroundTasks.php | 7 ----- Sources/Db/Schema/v3_0/BanGroups.php | 7 ----- Sources/Db/Schema/v3_0/BanItems.php | 7 ----- Sources/Db/Schema/v3_0/BoardPermissions.php | 11 ------- .../Db/Schema/v3_0/BoardPermissionsView.php | 11 ------- Sources/Db/Schema/v3_0/Boards.php | 18 ----------- Sources/Db/Schema/v3_0/Calendar.php | 7 ----- Sources/Db/Schema/v3_0/CalendarHolidays.php | 10 ------- Sources/Db/Schema/v3_0/Categories.php | 13 -------- Sources/Db/Schema/v3_0/CustomFields.php | 27 ----------------- Sources/Db/Schema/v3_0/GroupModerators.php | 7 ----- Sources/Db/Schema/v3_0/LogActions.php | 7 ----- Sources/Db/Schema/v3_0/LogActivity.php | 7 ----- Sources/Db/Schema/v3_0/LogBanned.php | 7 ----- Sources/Db/Schema/v3_0/LogBoards.php | 7 ----- Sources/Db/Schema/v3_0/LogComments.php | 7 ----- Sources/Db/Schema/v3_0/LogDigest.php | 7 ----- Sources/Db/Schema/v3_0/LogErrors.php | 7 ----- Sources/Db/Schema/v3_0/LogFloodcontrol.php | 7 ----- Sources/Db/Schema/v3_0/LogMarkRead.php | 7 ----- Sources/Db/Schema/v3_0/LogMemberNotices.php | 7 ----- Sources/Db/Schema/v3_0/LogNotify.php | 7 ----- Sources/Db/Schema/v3_0/LogOnline.php | 7 ----- Sources/Db/Schema/v3_0/LogPolls.php | 7 ----- Sources/Db/Schema/v3_0/LogReported.php | 7 ----- .../Db/Schema/v3_0/LogReportedComments.php | 7 ----- Sources/Db/Schema/v3_0/LogScheduledTasks.php | 7 ----- Sources/Db/Schema/v3_0/LogSearchMessages.php | 7 ----- Sources/Db/Schema/v3_0/LogSearchResults.php | 7 ----- Sources/Db/Schema/v3_0/LogSearchSubjects.php | 7 ----- Sources/Db/Schema/v3_0/LogSearchTopics.php | 7 ----- Sources/Db/Schema/v3_0/LogSpiderHits.php | 7 ----- Sources/Db/Schema/v3_0/LogSpiderStats.php | 7 ----- Sources/Db/Schema/v3_0/LogSubscribed.php | 7 ----- Sources/Db/Schema/v3_0/LogTopics.php | 7 ----- Sources/Db/Schema/v3_0/MailQueue.php | 7 ----- Sources/Db/Schema/v3_0/MemberLogins.php | 7 ----- Sources/Db/Schema/v3_0/Membergroups.php | 15 ---------- Sources/Db/Schema/v3_0/Members.php | 7 ----- Sources/Db/Schema/v3_0/Mentions.php | 7 ----- Sources/Db/Schema/v3_0/MessageIcons.php | 11 ------- Sources/Db/Schema/v3_0/Messages.php | 19 ------------ Sources/Db/Schema/v3_0/ModeratorGroups.php | 7 ----- Sources/Db/Schema/v3_0/Moderators.php | 7 ----- Sources/Db/Schema/v3_0/PackageServers.php | 11 ------- Sources/Db/Schema/v3_0/PermissionProfiles.php | 10 ------- Sources/Db/Schema/v3_0/Permissions.php | 10 ------- Sources/Db/Schema/v3_0/PersonalMessages.php | 7 ----- Sources/Db/Schema/v3_0/PmLabeledMessages.php | 7 ----- Sources/Db/Schema/v3_0/PmLabels.php | 7 ----- Sources/Db/Schema/v3_0/PmRecipients.php | 7 ----- Sources/Db/Schema/v3_0/PmRules.php | 7 ----- Sources/Db/Schema/v3_0/PollChoices.php | 7 ----- Sources/Db/Schema/v3_0/Polls.php | 7 ----- Sources/Db/Schema/v3_0/Qanda.php | 7 ----- Sources/Db/Schema/v3_0/ScheduledTasks.php | 16 ---------- Sources/Db/Schema/v3_0/Sessions.php | 7 ----- Sources/Db/Schema/v3_0/Settings.php | 10 ------- Sources/Db/Schema/v3_0/SmileyFiles.php | 7 ----- Sources/Db/Schema/v3_0/Smileys.php | 7 ----- Sources/Db/Schema/v3_0/Spiders.php | 11 ------- Sources/Db/Schema/v3_0/Subscriptions.php | 7 ----- Sources/Db/Schema/v3_0/Themes.php | 11 ------- Sources/Db/Schema/v3_0/Topics.php | 14 --------- Sources/Db/Schema/v3_0/UserAlerts.php | 7 ----- Sources/Db/Schema/v3_0/UserAlertsPrefs.php | 11 ------- Sources/Db/Schema/v3_0/UserDrafts.php | 7 ----- Sources/Db/Schema/v3_0/UserLikes.php | 7 ----- Sources/Maintenance/Tools/Install.php | 30 +++++++++++-------- 74 files changed, 22 insertions(+), 638 deletions(-) diff --git a/Sources/Db/Schema/Column.php b/Sources/Db/Schema/Column.php index 88f44d17f3..ed5f155374 100644 --- a/Sources/Db/Schema/Column.php +++ b/Sources/Db/Schema/Column.php @@ -63,7 +63,11 @@ class Column */ public ?bool $not_null; - /** @var string|float|int|bool|null Default value of the column. */ + /** + * @var string|float|int|bool|null + * + * Default value of the column. + */ public string|float|int|bool|null $default; /** diff --git a/Sources/Db/Schema/Table.php b/Sources/Db/Schema/Table.php index 512f6503a9..c0f795e84d 100644 --- a/Sources/Db/Schema/Table.php +++ b/Sources/Db/Schema/Table.php @@ -47,13 +47,6 @@ abstract class Table */ public array $indexes = []; - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/AdminInfoFiles.php b/Sources/Db/Schema/v3_0/AdminInfoFiles.php index aab77d87fa..4e26342f3f 100644 --- a/Sources/Db/Schema/v3_0/AdminInfoFiles.php +++ b/Sources/Db/Schema/v3_0/AdminInfoFiles.php @@ -28,20 +28,6 @@ class AdminInfoFiles extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_file' => 'int', - 'filename' => 'string', - 'path' => 'string', - 'parameters' => 'string', - 'data' => 'string', - 'filetype' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/ApprovalQueue.php b/Sources/Db/Schema/v3_0/ApprovalQueue.php index 000e5ee683..7cbc20fa2c 100644 --- a/Sources/Db/Schema/v3_0/ApprovalQueue.php +++ b/Sources/Db/Schema/v3_0/ApprovalQueue.php @@ -27,13 +27,6 @@ class ApprovalQueue extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Attachments.php b/Sources/Db/Schema/v3_0/Attachments.php index 3f7eac38bf..0cd5111f7b 100644 --- a/Sources/Db/Schema/v3_0/Attachments.php +++ b/Sources/Db/Schema/v3_0/Attachments.php @@ -28,13 +28,6 @@ class Attachments extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/BackgroundTasks.php b/Sources/Db/Schema/v3_0/BackgroundTasks.php index cf11618f74..18dda66f1a 100644 --- a/Sources/Db/Schema/v3_0/BackgroundTasks.php +++ b/Sources/Db/Schema/v3_0/BackgroundTasks.php @@ -28,13 +28,6 @@ class BackgroundTasks extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/BanGroups.php b/Sources/Db/Schema/v3_0/BanGroups.php index 97520ad2fa..793482c279 100644 --- a/Sources/Db/Schema/v3_0/BanGroups.php +++ b/Sources/Db/Schema/v3_0/BanGroups.php @@ -28,13 +28,6 @@ class BanGroups extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/BanItems.php b/Sources/Db/Schema/v3_0/BanItems.php index bfbe0216fc..824eb35036 100644 --- a/Sources/Db/Schema/v3_0/BanItems.php +++ b/Sources/Db/Schema/v3_0/BanItems.php @@ -28,13 +28,6 @@ class BanItems extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/BoardPermissions.php b/Sources/Db/Schema/v3_0/BoardPermissions.php index 64d81310ef..8c4898fe49 100644 --- a/Sources/Db/Schema/v3_0/BoardPermissions.php +++ b/Sources/Db/Schema/v3_0/BoardPermissions.php @@ -28,17 +28,6 @@ class BoardPermissions extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_group' => 'int', - 'id_profile' => 'int', - 'permission' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/BoardPermissionsView.php b/Sources/Db/Schema/v3_0/BoardPermissionsView.php index fe27b5a7a0..2646cdca30 100644 --- a/Sources/Db/Schema/v3_0/BoardPermissionsView.php +++ b/Sources/Db/Schema/v3_0/BoardPermissionsView.php @@ -28,17 +28,6 @@ class BoardPermissionsView extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_group' => 'int', - 'id_board' => 'int', - 'deny' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Boards.php b/Sources/Db/Schema/v3_0/Boards.php index 46924a5301..54f5dd5232 100644 --- a/Sources/Db/Schema/v3_0/Boards.php +++ b/Sources/Db/Schema/v3_0/Boards.php @@ -28,24 +28,6 @@ class Boards extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_board' => 'int', - 'id_cat' => 'int', - 'board_order' => 'int', - 'id_last_msg' => 'int', - 'id_msg_updated' => 'int', - 'name' => 'string', - 'description' => 'string', - 'num_topics' => 'int', - 'num_posts' => 'int', - 'member_groups' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Calendar.php b/Sources/Db/Schema/v3_0/Calendar.php index bcd618ff60..ddc92df200 100644 --- a/Sources/Db/Schema/v3_0/Calendar.php +++ b/Sources/Db/Schema/v3_0/Calendar.php @@ -28,13 +28,6 @@ class Calendar extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/CalendarHolidays.php b/Sources/Db/Schema/v3_0/CalendarHolidays.php index 4be7e4cbd1..9e8107c35f 100644 --- a/Sources/Db/Schema/v3_0/CalendarHolidays.php +++ b/Sources/Db/Schema/v3_0/CalendarHolidays.php @@ -28,16 +28,6 @@ class CalendarHolidays extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'title' => 'string', - 'event_date' => 'date', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Categories.php b/Sources/Db/Schema/v3_0/Categories.php index 904a8b4c66..5791e63521 100644 --- a/Sources/Db/Schema/v3_0/Categories.php +++ b/Sources/Db/Schema/v3_0/Categories.php @@ -28,19 +28,6 @@ class Categories extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_cat' => 'int', - 'cat_order' => 'int', - 'name' => 'string', - 'description' => 'string', - 'can_collapse' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/CustomFields.php b/Sources/Db/Schema/v3_0/CustomFields.php index bd7087b897..5908d8c3dc 100644 --- a/Sources/Db/Schema/v3_0/CustomFields.php +++ b/Sources/Db/Schema/v3_0/CustomFields.php @@ -28,33 +28,6 @@ class CustomFields extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'col_name' => 'string', - 'field_name' => 'string', - 'field_desc' => 'string', - 'field_type' => 'string', - 'field_length' => 'int', - 'field_options' => 'string', - 'field_order' => 'int', - 'mask' => 'string', - 'show_reg' => 'int', - 'show_display' => 'int', - 'show_mlist' => 'int', - 'show_profile' => 'string', - 'private' => 'int', - 'active' => 'int', - 'bbc' => 'int', - 'can_search' => 'int', - 'default_value' => 'string', - 'enclose' => ' string', - 'placement' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/GroupModerators.php b/Sources/Db/Schema/v3_0/GroupModerators.php index 10e7a20653..420848e79d 100644 --- a/Sources/Db/Schema/v3_0/GroupModerators.php +++ b/Sources/Db/Schema/v3_0/GroupModerators.php @@ -28,13 +28,6 @@ class GroupModerators extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogActions.php b/Sources/Db/Schema/v3_0/LogActions.php index eb5a28fa46..b27eace2a5 100644 --- a/Sources/Db/Schema/v3_0/LogActions.php +++ b/Sources/Db/Schema/v3_0/LogActions.php @@ -28,13 +28,6 @@ class LogActions extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogActivity.php b/Sources/Db/Schema/v3_0/LogActivity.php index 18cbd39af5..4220500429 100644 --- a/Sources/Db/Schema/v3_0/LogActivity.php +++ b/Sources/Db/Schema/v3_0/LogActivity.php @@ -28,13 +28,6 @@ class LogActivity extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogBanned.php b/Sources/Db/Schema/v3_0/LogBanned.php index a326a66d39..716a5e9b58 100644 --- a/Sources/Db/Schema/v3_0/LogBanned.php +++ b/Sources/Db/Schema/v3_0/LogBanned.php @@ -28,13 +28,6 @@ class LogBanned extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogBoards.php b/Sources/Db/Schema/v3_0/LogBoards.php index 31bf66868b..d232421501 100644 --- a/Sources/Db/Schema/v3_0/LogBoards.php +++ b/Sources/Db/Schema/v3_0/LogBoards.php @@ -28,13 +28,6 @@ class LogBoards extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogComments.php b/Sources/Db/Schema/v3_0/LogComments.php index 54e385304b..e4a6ccbca7 100644 --- a/Sources/Db/Schema/v3_0/LogComments.php +++ b/Sources/Db/Schema/v3_0/LogComments.php @@ -28,13 +28,6 @@ class LogComments extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogDigest.php b/Sources/Db/Schema/v3_0/LogDigest.php index d326b639db..98c50e1e31 100644 --- a/Sources/Db/Schema/v3_0/LogDigest.php +++ b/Sources/Db/Schema/v3_0/LogDigest.php @@ -27,13 +27,6 @@ class LogDigest extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogErrors.php b/Sources/Db/Schema/v3_0/LogErrors.php index 72b36752c8..8d58929f93 100644 --- a/Sources/Db/Schema/v3_0/LogErrors.php +++ b/Sources/Db/Schema/v3_0/LogErrors.php @@ -28,13 +28,6 @@ class LogErrors extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogFloodcontrol.php b/Sources/Db/Schema/v3_0/LogFloodcontrol.php index 0a39635c5e..6b1f77840c 100644 --- a/Sources/Db/Schema/v3_0/LogFloodcontrol.php +++ b/Sources/Db/Schema/v3_0/LogFloodcontrol.php @@ -28,13 +28,6 @@ class LogFloodcontrol extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogMarkRead.php b/Sources/Db/Schema/v3_0/LogMarkRead.php index 6a7911eef8..a1af23abfc 100644 --- a/Sources/Db/Schema/v3_0/LogMarkRead.php +++ b/Sources/Db/Schema/v3_0/LogMarkRead.php @@ -28,13 +28,6 @@ class LogMarkRead extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogMemberNotices.php b/Sources/Db/Schema/v3_0/LogMemberNotices.php index 4cb48b7f56..7278aceb34 100644 --- a/Sources/Db/Schema/v3_0/LogMemberNotices.php +++ b/Sources/Db/Schema/v3_0/LogMemberNotices.php @@ -28,13 +28,6 @@ class LogMemberNotices extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogNotify.php b/Sources/Db/Schema/v3_0/LogNotify.php index 6780808933..47755e697d 100644 --- a/Sources/Db/Schema/v3_0/LogNotify.php +++ b/Sources/Db/Schema/v3_0/LogNotify.php @@ -28,13 +28,6 @@ class LogNotify extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogOnline.php b/Sources/Db/Schema/v3_0/LogOnline.php index 448e54b1e4..15204d6871 100644 --- a/Sources/Db/Schema/v3_0/LogOnline.php +++ b/Sources/Db/Schema/v3_0/LogOnline.php @@ -28,13 +28,6 @@ class LogOnline extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogPolls.php b/Sources/Db/Schema/v3_0/LogPolls.php index 480a3e4a6d..c17966b478 100644 --- a/Sources/Db/Schema/v3_0/LogPolls.php +++ b/Sources/Db/Schema/v3_0/LogPolls.php @@ -28,13 +28,6 @@ class LogPolls extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogReported.php b/Sources/Db/Schema/v3_0/LogReported.php index 76fc8e4f3a..9cf92c99bf 100644 --- a/Sources/Db/Schema/v3_0/LogReported.php +++ b/Sources/Db/Schema/v3_0/LogReported.php @@ -28,13 +28,6 @@ class LogReported extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogReportedComments.php b/Sources/Db/Schema/v3_0/LogReportedComments.php index 2fc9435707..014ee904db 100644 --- a/Sources/Db/Schema/v3_0/LogReportedComments.php +++ b/Sources/Db/Schema/v3_0/LogReportedComments.php @@ -28,13 +28,6 @@ class LogReportedComments extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogScheduledTasks.php b/Sources/Db/Schema/v3_0/LogScheduledTasks.php index 610566270d..ebb938c739 100644 --- a/Sources/Db/Schema/v3_0/LogScheduledTasks.php +++ b/Sources/Db/Schema/v3_0/LogScheduledTasks.php @@ -28,13 +28,6 @@ class LogScheduledTasks extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSearchMessages.php b/Sources/Db/Schema/v3_0/LogSearchMessages.php index 05d22e8dc9..089b0e1308 100644 --- a/Sources/Db/Schema/v3_0/LogSearchMessages.php +++ b/Sources/Db/Schema/v3_0/LogSearchMessages.php @@ -28,13 +28,6 @@ class LogSearchMessages extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSearchResults.php b/Sources/Db/Schema/v3_0/LogSearchResults.php index ce07fe8006..f9f3516305 100644 --- a/Sources/Db/Schema/v3_0/LogSearchResults.php +++ b/Sources/Db/Schema/v3_0/LogSearchResults.php @@ -28,13 +28,6 @@ class LogSearchResults extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSearchSubjects.php b/Sources/Db/Schema/v3_0/LogSearchSubjects.php index cc5852c8a7..66bfcb822c 100644 --- a/Sources/Db/Schema/v3_0/LogSearchSubjects.php +++ b/Sources/Db/Schema/v3_0/LogSearchSubjects.php @@ -28,13 +28,6 @@ class LogSearchSubjects extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSearchTopics.php b/Sources/Db/Schema/v3_0/LogSearchTopics.php index f31822c273..15d3e9cae5 100644 --- a/Sources/Db/Schema/v3_0/LogSearchTopics.php +++ b/Sources/Db/Schema/v3_0/LogSearchTopics.php @@ -28,13 +28,6 @@ class LogSearchTopics extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSpiderHits.php b/Sources/Db/Schema/v3_0/LogSpiderHits.php index 2756ee53b8..6343d2ac1c 100644 --- a/Sources/Db/Schema/v3_0/LogSpiderHits.php +++ b/Sources/Db/Schema/v3_0/LogSpiderHits.php @@ -28,13 +28,6 @@ class LogSpiderHits extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSpiderStats.php b/Sources/Db/Schema/v3_0/LogSpiderStats.php index 7b59feece3..605625a7fc 100644 --- a/Sources/Db/Schema/v3_0/LogSpiderStats.php +++ b/Sources/Db/Schema/v3_0/LogSpiderStats.php @@ -28,13 +28,6 @@ class LogSpiderStats extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogSubscribed.php b/Sources/Db/Schema/v3_0/LogSubscribed.php index 99a6c7279a..242476d9d3 100644 --- a/Sources/Db/Schema/v3_0/LogSubscribed.php +++ b/Sources/Db/Schema/v3_0/LogSubscribed.php @@ -28,13 +28,6 @@ class LogSubscribed extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/LogTopics.php b/Sources/Db/Schema/v3_0/LogTopics.php index 2602b03609..edefcf7a43 100644 --- a/Sources/Db/Schema/v3_0/LogTopics.php +++ b/Sources/Db/Schema/v3_0/LogTopics.php @@ -28,13 +28,6 @@ class LogTopics extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/MailQueue.php b/Sources/Db/Schema/v3_0/MailQueue.php index 56a848bed2..1240bfdd52 100644 --- a/Sources/Db/Schema/v3_0/MailQueue.php +++ b/Sources/Db/Schema/v3_0/MailQueue.php @@ -28,13 +28,6 @@ class MailQueue extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/MemberLogins.php b/Sources/Db/Schema/v3_0/MemberLogins.php index f3b99864ac..0771ebae60 100644 --- a/Sources/Db/Schema/v3_0/MemberLogins.php +++ b/Sources/Db/Schema/v3_0/MemberLogins.php @@ -28,13 +28,6 @@ class MemberLogins extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Membergroups.php b/Sources/Db/Schema/v3_0/Membergroups.php index 804dd63d30..785ea9d79b 100644 --- a/Sources/Db/Schema/v3_0/Membergroups.php +++ b/Sources/Db/Schema/v3_0/Membergroups.php @@ -28,21 +28,6 @@ class Membergroups extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_group' => 'int', - 'group_name' => 'string', - 'description' => 'string', - 'online_color' => 'string', - 'min_posts' => 'int', - 'icons' => 'string', - 'group_type' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Members.php b/Sources/Db/Schema/v3_0/Members.php index 83c9ed1ace..13cb8cdd8f 100644 --- a/Sources/Db/Schema/v3_0/Members.php +++ b/Sources/Db/Schema/v3_0/Members.php @@ -28,13 +28,6 @@ class Members extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Mentions.php b/Sources/Db/Schema/v3_0/Mentions.php index 1bc7aa361a..2854001214 100644 --- a/Sources/Db/Schema/v3_0/Mentions.php +++ b/Sources/Db/Schema/v3_0/Mentions.php @@ -28,13 +28,6 @@ class Mentions extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/MessageIcons.php b/Sources/Db/Schema/v3_0/MessageIcons.php index 56c89e4812..5cff8fc461 100644 --- a/Sources/Db/Schema/v3_0/MessageIcons.php +++ b/Sources/Db/Schema/v3_0/MessageIcons.php @@ -28,17 +28,6 @@ class MessageIcons extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'filename' => 'string', - 'title' => 'string', - 'icon_order' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Messages.php b/Sources/Db/Schema/v3_0/Messages.php index ec9cbd78ba..d217b2627f 100644 --- a/Sources/Db/Schema/v3_0/Messages.php +++ b/Sources/Db/Schema/v3_0/Messages.php @@ -28,25 +28,6 @@ class Messages extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_msg' => 'int', - 'id_msg_modified' => 'int', - 'id_topic' => 'int', - 'id_board' => 'int', - 'poster_time' => 'int', - 'subject' => 'string', - 'poster_name' => 'string', - 'poster_email' => 'string', - 'modified_name' => 'string', - 'body' => 'string', - 'icon' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/ModeratorGroups.php b/Sources/Db/Schema/v3_0/ModeratorGroups.php index fc86e842f4..6cb2254a0f 100644 --- a/Sources/Db/Schema/v3_0/ModeratorGroups.php +++ b/Sources/Db/Schema/v3_0/ModeratorGroups.php @@ -28,13 +28,6 @@ class ModeratorGroups extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Moderators.php b/Sources/Db/Schema/v3_0/Moderators.php index 6d3c07ec2a..0f6d3e2c37 100644 --- a/Sources/Db/Schema/v3_0/Moderators.php +++ b/Sources/Db/Schema/v3_0/Moderators.php @@ -28,13 +28,6 @@ class Moderators extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PackageServers.php b/Sources/Db/Schema/v3_0/PackageServers.php index 312704cb01..b04ed632fb 100644 --- a/Sources/Db/Schema/v3_0/PackageServers.php +++ b/Sources/Db/Schema/v3_0/PackageServers.php @@ -28,17 +28,6 @@ class PackageServers extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'name' => 'string', - 'url' => 'string', - 'validation_url' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PermissionProfiles.php b/Sources/Db/Schema/v3_0/PermissionProfiles.php index 1a50e1f0ca..f945c12733 100644 --- a/Sources/Db/Schema/v3_0/PermissionProfiles.php +++ b/Sources/Db/Schema/v3_0/PermissionProfiles.php @@ -28,16 +28,6 @@ class PermissionProfiles extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_profile' => 'int', - 'profile_name' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Permissions.php b/Sources/Db/Schema/v3_0/Permissions.php index 7e845ab6f7..2f1f8b09bf 100644 --- a/Sources/Db/Schema/v3_0/Permissions.php +++ b/Sources/Db/Schema/v3_0/Permissions.php @@ -28,16 +28,6 @@ class Permissions extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_group' => 'int', - 'permission' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PersonalMessages.php b/Sources/Db/Schema/v3_0/PersonalMessages.php index ebce8c02f8..91f6031b80 100644 --- a/Sources/Db/Schema/v3_0/PersonalMessages.php +++ b/Sources/Db/Schema/v3_0/PersonalMessages.php @@ -28,13 +28,6 @@ class PersonalMessages extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PmLabeledMessages.php b/Sources/Db/Schema/v3_0/PmLabeledMessages.php index 0c30f2c591..36d52c5d3e 100644 --- a/Sources/Db/Schema/v3_0/PmLabeledMessages.php +++ b/Sources/Db/Schema/v3_0/PmLabeledMessages.php @@ -28,13 +28,6 @@ class PmLabeledMessages extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PmLabels.php b/Sources/Db/Schema/v3_0/PmLabels.php index 8a3f326799..b9f2c90373 100644 --- a/Sources/Db/Schema/v3_0/PmLabels.php +++ b/Sources/Db/Schema/v3_0/PmLabels.php @@ -28,13 +28,6 @@ class PmLabels extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PmRecipients.php b/Sources/Db/Schema/v3_0/PmRecipients.php index f0b8acdf9e..fbbcec953f 100644 --- a/Sources/Db/Schema/v3_0/PmRecipients.php +++ b/Sources/Db/Schema/v3_0/PmRecipients.php @@ -28,13 +28,6 @@ class PmRecipients extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PmRules.php b/Sources/Db/Schema/v3_0/PmRules.php index dc367f968f..84c0523e67 100644 --- a/Sources/Db/Schema/v3_0/PmRules.php +++ b/Sources/Db/Schema/v3_0/PmRules.php @@ -28,13 +28,6 @@ class PmRules extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/PollChoices.php b/Sources/Db/Schema/v3_0/PollChoices.php index bd41028903..2d6f895b6a 100644 --- a/Sources/Db/Schema/v3_0/PollChoices.php +++ b/Sources/Db/Schema/v3_0/PollChoices.php @@ -28,13 +28,6 @@ class PollChoices extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Polls.php b/Sources/Db/Schema/v3_0/Polls.php index ecde4d5ef1..75edda3806 100644 --- a/Sources/Db/Schema/v3_0/Polls.php +++ b/Sources/Db/Schema/v3_0/Polls.php @@ -28,13 +28,6 @@ class Polls extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Qanda.php b/Sources/Db/Schema/v3_0/Qanda.php index e82adb9d3a..d51ed4ef3b 100644 --- a/Sources/Db/Schema/v3_0/Qanda.php +++ b/Sources/Db/Schema/v3_0/Qanda.php @@ -28,13 +28,6 @@ class Qanda extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/ScheduledTasks.php b/Sources/Db/Schema/v3_0/ScheduledTasks.php index 30ee80ba64..b22fae07b6 100644 --- a/Sources/Db/Schema/v3_0/ScheduledTasks.php +++ b/Sources/Db/Schema/v3_0/ScheduledTasks.php @@ -28,22 +28,6 @@ class ScheduledTasks extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_task' => 'int', - 'next_time' => 'int', - 'time_offset' => 'int', - 'time_regularity' => 'int', - 'time_unit' => 'string', - 'disabled' => 'int', - 'task' => 'string', - 'callable' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Sessions.php b/Sources/Db/Schema/v3_0/Sessions.php index f05062d7c5..2598f24036 100644 --- a/Sources/Db/Schema/v3_0/Sessions.php +++ b/Sources/Db/Schema/v3_0/Sessions.php @@ -28,13 +28,6 @@ class Sessions extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Settings.php b/Sources/Db/Schema/v3_0/Settings.php index 11cf5a2ad7..487b10858c 100644 --- a/Sources/Db/Schema/v3_0/Settings.php +++ b/Sources/Db/Schema/v3_0/Settings.php @@ -28,16 +28,6 @@ class Settings extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'variable' => 'string', - 'value' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/SmileyFiles.php b/Sources/Db/Schema/v3_0/SmileyFiles.php index a7d38921b2..2273d1c634 100644 --- a/Sources/Db/Schema/v3_0/SmileyFiles.php +++ b/Sources/Db/Schema/v3_0/SmileyFiles.php @@ -28,13 +28,6 @@ class SmileyFiles extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Smileys.php b/Sources/Db/Schema/v3_0/Smileys.php index f6098de1a7..3fbf7e7219 100644 --- a/Sources/Db/Schema/v3_0/Smileys.php +++ b/Sources/Db/Schema/v3_0/Smileys.php @@ -28,13 +28,6 @@ class Smileys extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Spiders.php b/Sources/Db/Schema/v3_0/Spiders.php index 83522e59a8..62c28ee68a 100644 --- a/Sources/Db/Schema/v3_0/Spiders.php +++ b/Sources/Db/Schema/v3_0/Spiders.php @@ -28,17 +28,6 @@ class Spiders extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'spider_name' => 'string', - 'user_agent' => 'string', - 'ip_info' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Subscriptions.php b/Sources/Db/Schema/v3_0/Subscriptions.php index 6d4fbff866..eaa77c0635 100644 --- a/Sources/Db/Schema/v3_0/Subscriptions.php +++ b/Sources/Db/Schema/v3_0/Subscriptions.php @@ -28,13 +28,6 @@ class Subscriptions extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Themes.php b/Sources/Db/Schema/v3_0/Themes.php index 65c1d8af07..32ba945cf7 100644 --- a/Sources/Db/Schema/v3_0/Themes.php +++ b/Sources/Db/Schema/v3_0/Themes.php @@ -28,17 +28,6 @@ class Themes extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_theme' => 'int', - 'variable' => 'string', - 'value' => 'string', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/Topics.php b/Sources/Db/Schema/v3_0/Topics.php index 6231a87148..d289f0b89d 100644 --- a/Sources/Db/Schema/v3_0/Topics.php +++ b/Sources/Db/Schema/v3_0/Topics.php @@ -28,20 +28,6 @@ class Topics extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_topic' => 'int', - 'id_board' => 'int', - 'id_first_msg' => 'int', - 'id_last_msg' => 'int', - 'id_member_started' => 'int', - 'id_member_updated' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/UserAlerts.php b/Sources/Db/Schema/v3_0/UserAlerts.php index dc341eee62..a256c58ce7 100644 --- a/Sources/Db/Schema/v3_0/UserAlerts.php +++ b/Sources/Db/Schema/v3_0/UserAlerts.php @@ -28,13 +28,6 @@ class UserAlerts extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/UserAlertsPrefs.php b/Sources/Db/Schema/v3_0/UserAlertsPrefs.php index 09fc32ee78..d1e7663850 100644 --- a/Sources/Db/Schema/v3_0/UserAlertsPrefs.php +++ b/Sources/Db/Schema/v3_0/UserAlertsPrefs.php @@ -28,17 +28,6 @@ class UserAlertsPrefs extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = [ - 'id_member' => 'int', - 'alert_pref' => 'string', - 'alert_value' => 'int', - ]; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/UserDrafts.php b/Sources/Db/Schema/v3_0/UserDrafts.php index e89fc8d52e..0cad2b826b 100644 --- a/Sources/Db/Schema/v3_0/UserDrafts.php +++ b/Sources/Db/Schema/v3_0/UserDrafts.php @@ -28,13 +28,6 @@ class UserDrafts extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Db/Schema/v3_0/UserLikes.php b/Sources/Db/Schema/v3_0/UserLikes.php index 04b7159b85..8254a52d45 100644 --- a/Sources/Db/Schema/v3_0/UserLikes.php +++ b/Sources/Db/Schema/v3_0/UserLikes.php @@ -28,13 +28,6 @@ class UserLikes extends Table * Public properties *******************/ - /** - * @var array - * - * Initial columns for inserts. - */ - public array $initial_columns = []; - /** * @var array * diff --git a/Sources/Maintenance/Tools/Install.php b/Sources/Maintenance/Tools/Install.php index 91cd820de6..3c9202f191 100644 --- a/Sources/Maintenance/Tools/Install.php +++ b/Sources/Maintenance/Tools/Install.php @@ -950,19 +950,23 @@ public function databasePopulation(): bool try { if (!empty($tbl->initial_data)) { - foreach ($tbl->initial_data as &$col) { - foreach ($col as $key => &$value) { + $casts = []; + $insert_columns = []; + + foreach ($tbl->columns as $column) { + $casts[$column->name] = in_array($column->type, ['tinyint', 'smallint', 'mediumint', 'bigint', 'int', 'integer']) ? 'int' : 'string'; + } + + foreach ($tbl->initial_data as &$row) { + foreach ($row as $column => &$value) { + if (!isset($insert_columns[$column])) { + $insert_columns[$column] = $casts[$column]; + } + + $value = settype($value, $casts[$column]); + if (is_string($value)) { $value = strtr($value, $replaces); - } elseif (isset($tbl->initial_columns[$key])) { - switch ($tbl->initial_columns[$key]) { - case 'int': - $value = (int) $value; - break; - - default: - $value = (string) $value; - } } } } @@ -970,9 +974,9 @@ public function databasePopulation(): bool $result = Db::$db->insert( 'replace', $tbl->name, - $tbl->initial_columns, + $insert_columns, $tbl->initial_data, - array_keys($tbl->initial_columns), + array_keys($insert_columns), ); if ($result || $result === null) {