aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/postgres
diff options
context:
space:
mode:
authorDerk-Jan Hartman <hartman.wiki@gmail.com>2024-06-17 00:29:38 +0200
committerTheDJ <hartman.wiki@gmail.com>2024-10-23 20:13:05 +0000
commita2ba7ee14d6b38a5e89bcc63c3bd0ca8b5107702 (patch)
tree2ef466e25b3556516784efd7dddf29ac00bd76e4 /maintenance/postgres
parentfca44bf6f8eabf8d23a9af4e89ccd0ce57e046b9 (diff)
downloadmediawikicore-a2ba7ee14d6b38a5e89bcc63c3bd0ca8b5107702.tar.gz
mediawikicore-a2ba7ee14d6b38a5e89bcc63c3bd0ca8b5107702.zip
Searchindex primary key, title length and utf8mb4
- Make si_page primary key - Allow si_title to be larger - Switch from utf8 to utf8mb4 - Remove default of empty string for titles Sqlite is not migrated, as it has it's own overrides Postgres is migrated, but is not in actual use This is mostly from I273e3a7715abf97d2889904642c7c375e76de4f6 Bug: T249976 Bug: T231827 Change-Id: I12adff3e6ca6a9986ff207bef16272195c3a6a48
Diffstat (limited to 'maintenance/postgres')
-rw-r--r--maintenance/postgres/archives/patch-searchindex-pk-titlelength.sql12
-rw-r--r--maintenance/postgres/tables-generated.sql7
2 files changed, 15 insertions, 4 deletions
diff --git a/maintenance/postgres/archives/patch-searchindex-pk-titlelength.sql b/maintenance/postgres/archives/patch-searchindex-pk-titlelength.sql
new file mode 100644
index 000000000000..cee04e5b2aa9
--- /dev/null
+++ b/maintenance/postgres/archives/patch-searchindex-pk-titlelength.sql
@@ -0,0 +1,12 @@
+-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
+-- Source: maintenance/abstractSchemaChanges/patch-searchindex-innodb-pk-titlelength.json
+-- Do not modify this file directly.
+-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
+DROP INDEX si_page;
+ALTER TABLE searchindex
+ ALTER si_title
+ DROP DEFAULT;
+ALTER TABLE searchindex
+ ALTER si_title TYPE TEXT;
+ALTER TABLE searchindex
+ ADD PRIMARY KEY (si_page);
diff --git a/maintenance/postgres/tables-generated.sql b/maintenance/postgres/tables-generated.sql
index 659c01ef10dc..b3e989e667f6 100644
--- a/maintenance/postgres/tables-generated.sql
+++ b/maintenance/postgres/tables-generated.sql
@@ -920,12 +920,11 @@ CREATE INDEX rev_page_actor_timestamp ON revision (
CREATE TABLE searchindex (
si_page INT NOT NULL,
- si_title VARCHAR(255) DEFAULT '' NOT NULL,
- si_text TEXT NOT NULL
+ si_title TEXT NOT NULL,
+ si_text TEXT NOT NULL,
+ PRIMARY KEY(si_page)
);
-CREATE UNIQUE INDEX si_page ON searchindex (si_page);
-
CREATE INDEX si_title ON searchindex (si_title);
CREATE INDEX si_text ON searchindex (si_text);