Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/228756

Change subject: Resize wb_items_per_site.ips_site_page to VARCHAR(310)
......................................................................

Resize wb_items_per_site.ips_site_page to VARCHAR(310)

I decided to go for VARCHAR(310) to have some headroom
for future changes to namespaces, yet keep it as small
as possible.
update.php tested with both SQLite and MySQL.

Bug: T99459
Change-Id: I54545b2ae5592a89dee669c2f1d9448d0515e1f5
---
M repo/includes/store/sql/SqlStore.php
A repo/sql/MakeIpsSitePageLarger.sql
M repo/sql/Wikibase.sql
3 files changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/56/228756/1

diff --git a/repo/includes/store/sql/SqlStore.php 
b/repo/includes/store/sql/SqlStore.php
index 18cc3a6..f34b2e0 100644
--- a/repo/includes/store/sql/SqlStore.php
+++ b/repo/includes/store/sql/SqlStore.php
@@ -456,6 +456,16 @@
                        '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/MakeIpsSitePageLarger.sql 
b/repo/sql/MakeIpsSitePageLarger.sql
new file mode 100644
index 0000000..b7e97ae
--- /dev/null
+++ b/repo/sql/MakeIpsSitePageLarger.sql
@@ -0,0 +1,4 @@
+-- Update ips_site_page to VARCHAR(310) per T99459
+
+ALTER TABLE /*_*/wb_items_per_site
+MODIFY ips_site_page VARCHAR(310) NOT NULL;
diff --git a/repo/sql/Wikibase.sql b/repo/sql/Wikibase.sql
index 9969d8f..e4a5c5e 100644
--- a/repo/sql/Wikibase.sql
+++ b/repo/sql/Wikibase.sql
@@ -21,7 +21,7 @@
   ips_row_id                 BIGINT unsigned     NOT NULL PRIMARY KEY 
AUTO_INCREMENT, -- row ID
   ips_item_id                INT unsigned        NOT NULL, -- Id of the item
   ips_site_id                VARBINARY(32)       NOT NULL, -- Site identifier 
(global)
-  ips_site_page              VARCHAR(255)        NOT NULL -- Title of the page
+  ips_site_page              VARCHAR(310)        NOT NULL -- Prefixed title of 
the page
 ) /*$wgDBTableOptions*/;
 
 CREATE UNIQUE INDEX /*i*/wb_ips_item_site_page ON /*_*/wb_items_per_site 
(ips_site_id, ips_site_page);

-- 
To view, visit https://gerrit.wikimedia.org/r/228756
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54545b2ae5592a89dee669c2f1d9448d0515e1f5
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

Reply via email to