diff options
author | Amir Sarabadani <Ladsgroup@gmail.com> | 2021-03-13 20:49:25 +0100 |
---|---|---|
committer | Amir Sarabadani <Ladsgroup@gmail.com> | 2021-03-13 21:51:16 +0100 |
commit | 2cc79854e8d29014763ae6c6ad8ac390d3ceb8a6 (patch) | |
tree | c5a92118287ed53a320c536d48514627ec9728ee /maintenance/postgres/tables.sql | |
parent | 06f3ba24b1c7f5974888c38e8e4047dfd0f5842e (diff) | |
download | mediawikicore-2cc79854e8d29014763ae6c6ad8ac390d3ceb8a6.tar.gz mediawikicore-2cc79854e8d29014763ae6c6ad8ac390d3ceb8a6.zip |
Migrate archive table to abstract schema
One of the last ones left.
For MySQL/Sqlite:
- Dropping default of ar_timestamp, empty string is not a valid
timestamp.
- Changing ar_title from "varchar() binary" to varbinary
for Postgres:
- Set default for ar_namespace and ar_title
- Change datatype of ar_comment_id, ar_actor, ar_namespace
The indexes were fixed separately.
Bug: T230428
Bug: T164898
Bug: T42626
Depends-On: I83cf1cd51ac9cf933c9175cefd6e38a6914f3494
Change-Id: Ic1d13a82b27f7fa39a0f0ea9c5b7b193b007e4ab
Diffstat (limited to 'maintenance/postgres/tables.sql')
-rw-r--r-- | maintenance/postgres/tables.sql | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index f2128ba61bed..9bfa026a35aa 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -94,28 +94,6 @@ CREATE INDEX rev_actor_timestamp ON revision (rev_actor,rev_timestamp,rev_id) CREATE INDEX rev_page_actor_timestamp ON revision (rev_page,rev_actor,rev_timestamp); -CREATE SEQUENCE archive_ar_id_seq; -CREATE TABLE archive ( - ar_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('archive_ar_id_seq'), - ar_namespace SMALLINT NOT NULL, - ar_title TEXT NOT NULL, - ar_page_id INTEGER NULL, - ar_parent_id INTEGER NULL, - ar_sha1 TEXT NOT NULL DEFAULT '', - ar_comment_id INTEGER NOT NULL, - ar_actor INTEGER NOT NULL, - ar_timestamp TIMESTAMPTZ NOT NULL, - ar_minor_edit SMALLINT NOT NULL DEFAULT 0, - ar_rev_id INTEGER NOT NULL, - ar_deleted SMALLINT NOT NULL DEFAULT 0, - ar_len INTEGER NULL -); -ALTER SEQUENCE archive_ar_id_seq OWNED BY archive.ar_id; -CREATE INDEX ar_name_title_timestamp ON archive (ar_namespace,ar_title,ar_timestamp); -CREATE INDEX ar_actor_timestamp ON archive (ar_actor,ar_timestamp); -CREATE UNIQUE INDEX ar_revid_uniq ON archive (ar_rev_id); - - -- Tsearch2 2 stuff. Will fail if we don't have proper access to the tsearch2 tables -- Make sure you also change patch-tsearch2funcs.sql if the funcs below change. ALTER TABLE page ADD titlevector tsvector; |