diff options
Diffstat (limited to 'maintenance/postgres')
-rw-r--r-- | maintenance/postgres/mediawiki_mysql2postgres.pl | 2 | ||||
-rw-r--r-- | maintenance/postgres/tables.sql | 23 |
2 files changed, 8 insertions, 17 deletions
diff --git a/maintenance/postgres/mediawiki_mysql2postgres.pl b/maintenance/postgres/mediawiki_mysql2postgres.pl index 9133477e..8f170abc 100644 --- a/maintenance/postgres/mediawiki_mysql2postgres.pl +++ b/maintenance/postgres/mediawiki_mysql2postgres.pl @@ -417,7 +417,6 @@ SELECT setval('page_restrictions_pr_id_seq', 1+coalesce(max(pr_id) ,0),false) F SELECT setval('recentchanges_rc_id_seq', 1+coalesce(max(rc_id) ,0),false) FROM recentchanges; SELECT setval('revision_rev_id_seq', 1+coalesce(max(rev_id) ,0),false) FROM revision; SELECT setval('text_old_id_seq', 1+coalesce(max(old_id) ,0),false) FROM pagecontent; -SELECT setval('trackbacks_tb_id_seq', 1+coalesce(max(tb_id) ,0),false) FROM trackbacks; SELECT setval('user_user_id_seq', 1+coalesce(max(user_id),0),false) FROM mwuser; }; @@ -437,7 +436,6 @@ profiling objectcache ## Which tables to ignore depending on the version -VERSION 1.5: trackback VERSION 1.6: externallinks job templatelinks transcache VERSION 1.7: filearchive langlinks querycache_info VERSION 1.9: querycachetwo page_restrictions redirect diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index 9f6b8049..6890df91 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -16,7 +16,6 @@ DROP SEQUENCE IF EXISTS page_restrictions_id_seq CASCADE; DROP SEQUENCE IF EXISTS ipblocks_ipb_id_seq CASCADE; DROP SEQUENCE IF EXISTS recentchanges_rc_id_seq CASCADE; DROP SEQUENCE IF EXISTS logging_log_id_seq CASCADE; -DROP SEQUENCE IF EXISTS trackbacks_tb_id_seq CASCADE; DROP SEQUENCE IF EXISTS job_job_id_seq CASCADE; DROP SEQUENCE IF EXISTS category_cat_id_seq CASCADE; DROP FUNCTION IF EXISTS page_deleted() CASCADE; @@ -116,7 +115,8 @@ CREATE TABLE revision ( rev_minor_edit SMALLINT NOT NULL DEFAULT 0, rev_deleted SMALLINT NOT NULL DEFAULT 0, rev_len INTEGER NULL, - rev_parent_id INTEGER NULL + rev_parent_id INTEGER NULL, + rev_sha1 TEXT NOT NULL DEFAULT '' ); CREATE UNIQUE INDEX revision_unique ON revision (rev_page, rev_id); CREATE INDEX rev_text_id_idx ON revision (rev_text_id); @@ -159,6 +159,7 @@ CREATE TABLE archive ( ar_text TEXT, -- technically should be bytea, but not used anymore ar_page_id INTEGER NULL, ar_parent_id INTEGER NULL, + ar_sha1 TEXT NOT NULL DEFAULT '', ar_comment TEXT, ar_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED, ar_user_text TEXT NOT NULL, @@ -358,11 +359,11 @@ CREATE INDEX fa_dupe ON filearchive (fa_storage_group, fa_storage_key); CREATE INDEX fa_notime ON filearchive (fa_deleted_timestamp); CREATE INDEX fa_nouser ON filearchive (fa_deleted_user); -CREATE SEQUENCE us_id_seq; +CREATE SEQUENCE uploadstash_us_id_seq; CREATE TYPE media_type AS ENUM ('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE'); CREATE TABLE uploadstash ( - us_id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('us_id_seq'), + us_id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('uploadstash_us_id_seq'), us_user INTEGER, us_key TEXT, us_orig_path TEXT, @@ -370,6 +371,7 @@ CREATE TABLE uploadstash ( us_source_type TEXT, us_timestamp TIMESTAMPTZ, us_status TEXT, + us_chunk_inx INTEGER NULL, us_size INTEGER, us_sha1 TEXT, us_mime TEXT, @@ -510,17 +512,6 @@ CREATE TABLE log_search ( ); CREATE INDEX ls_log_id ON log_search (ls_log_id); -CREATE SEQUENCE trackbacks_tb_id_seq; -CREATE TABLE trackbacks ( - tb_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('trackbacks_tb_id_seq'), - tb_page INTEGER REFERENCES page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, - tb_title TEXT NOT NULL, - tb_url TEXT NOT NULL, - tb_ex TEXT, - tb_name TEXT -); -CREATE INDEX trackback_page ON trackbacks (tb_page); - CREATE SEQUENCE job_job_id_seq; CREATE TABLE job ( @@ -528,9 +519,11 @@ CREATE TABLE job ( job_cmd TEXT NOT NULL, job_namespace SMALLINT NOT NULL, job_title TEXT NOT NULL, + job_timestamp TIMESTAMPTZ, job_params TEXT NOT NULL ); CREATE INDEX job_cmd_namespace_title ON job (job_cmd, job_namespace, job_title); +CREATE INDEX job_timestamp_idx ON job (job_timestamp); -- Tsearch2 2 stuff. Will fail if we don't have proper access to the tsearch2 tables -- Version 8.3 or higher only. Previous versions would need another parmeter for to_tsvector. |