Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/230301
Change subject: Change wb_changes.change_info to MEDIUMBLOB
......................................................................
Change wb_changes.change_info to MEDIUMBLOB
Bug: T108246
Change-Id: Ibc0a02cbc9fc63226876e23c986f09f4e2a42c79
---
M repo/includes/store/sql/SqlStore.php
A repo/sql/MakeChangeInfoLarger.sql
M repo/sql/changes.sql
3 files changed, 40 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/01/230301/1
diff --git a/repo/includes/store/sql/SqlStore.php
b/repo/includes/store/sql/SqlStore.php
index 8c45cce..2d1a18a 100644
--- a/repo/includes/store/sql/SqlStore.php
+++ b/repo/includes/store/sql/SqlStore.php
@@ -232,6 +232,8 @@
/**
* Updates the schema of the SQL store to it's latest version.
*
+ * @TODO: Make this a separatec class!
+ *
* @since 0.1
*
* @param DatabaseUpdater $updater
@@ -256,8 +258,40 @@
$this->updateEntityPerPageTable( $updater, $db );
$this->updateTermsTable( $updater, $db );
+ $this->updateItemsPerSiteTable( $updater, $db );
+ $this->updateChangesTable( $updater, $db );
$this->registerPropertyInfoTableUpdates( $updater );
+ }
+
+ /**
+ * @param DatabaseUpdater $updater
+ */
+ private function updateItemsPerSiteTable( DatabaseUpdater $updater,
DatabaseBase $db ) {
+ // Make wb_items_per_site.ips_site_page VARCHAR(310) - T99459
+ // NOTE: this update doesn't work on SQLite, but it's not
needed there anyway.
+ if ( $db->getType() !== 'sqlite' ) {
+ $updater->modifyExtensionField(
+ 'wb_items_per_site',
+ 'ips_site_page',
+ $this->getUpdateScriptPath(
'MakeIpsSitePageLarger', $db->getType() )
+ );
+ }
+ }
+
+ /**
+ * @param DatabaseUpdater $updater
+ */
+ private function updateChangesTable( DatabaseUpdater $updater,
DatabaseBase $db ) {
+ // Make wb_changes.change_info MEDIUMBLOB - T108246
+ // NOTE: this update doesn't work on SQLite, but it's not
needed there anyway.
+ if ( $db->getType() !== 'sqlite' ) {
+ $updater->modifyExtensionField(
+ 'wb_changes',
+ 'change_info',
+ $this->getUpdateScriptPath(
'MakeChangeInfoLarger', $db->getType() )
+ );
+ }
}
private function registerPropertyInfoTableUpdates( DatabaseUpdater
$updater ) {
@@ -456,16 +490,6 @@
'term_search',
$this->getUpdateScriptPath( 'UpdateTermIndexes',
$db->getType() )
);
-
- // Make wb_items_per_site.ips_site_page VARCHAR(310) - T99459
- // NOTE: this update doesn't work on SQLite, but it's not
needed there anyway.
- if ( $db->getType() !== 'sqlite' ) {
- $updater->modifyExtensionField(
- 'wb_items_per_site',
- 'ips_site_page',
- $this->getUpdateScriptPath(
'MakeIpsSitePageLarger', $db->getType() )
- );
- }
}
/**
diff --git a/repo/sql/MakeChangeInfoLarger.sql
b/repo/sql/MakeChangeInfoLarger.sql
new file mode 100644
index 0000000..8b062ca
--- /dev/null
+++ b/repo/sql/MakeChangeInfoLarger.sql
@@ -0,0 +1,4 @@
+-- Update wb_changes.change_info to MEDIUMBLOB - T108246
+
+ALTER TABLE /*_*/wb_changes
+MODIFY change_info MEDIUMBLOB NOT NULL;
diff --git a/repo/sql/changes.sql b/repo/sql/changes.sql
index 0b0c6cd..be8be7b 100644
--- a/repo/sql/changes.sql
+++ b/repo/sql/changes.sql
@@ -11,11 +11,11 @@
change_object_id varbinary(14) NOT NULL, -- The full id of
the object (ie item, query) the change affects
change_revision_id INT unsigned NOT NULL, -- The id of the
revision on the repo that made the change
change_user_id INT unsigned NOT NULL, -- The id of the
user on the repo that made the change
- change_info BLOB NOT NULL -- Holds additional
info about the change, inc diff and stuff
+ change_info MEDIUMBLOB NOT NULL -- Holds additional
info about the change, inc diff and stuff
) /*$wgDBTableOptions*/;
CREATE INDEX /*i*/wb_changes_change_type ON /*_*/wb_changes (change_type);
CREATE INDEX /*i*/wb_changes_change_time ON /*_*/wb_changes (change_time);
CREATE INDEX /*i*/wb_changes_change_object_id ON /*_*/wb_changes
(change_object_id);
CREATE INDEX /*i*/wb_changes_change_user_id ON /*_*/wb_changes
(change_user_id);
-CREATE INDEX /*i*/wb_changes_change_revision_id ON /*_*/wb_changes
(change_revision_id);
\ No newline at end of file
+CREATE INDEX /*i*/wb_changes_change_revision_id ON /*_*/wb_changes
(change_revision_id);
--
To view, visit https://gerrit.wikimedia.org/r/230301
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc0a02cbc9fc63226876e23c986f09f4e2a42c79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits