WMF DBAs have been doing a massive effort to convert UNIQUE KEYS into PRIMARY KEY. Having a PK is essential to do maintenance, specially on large tasks. By not having a PK it is impossible to add it in a safe way if not done directly on the master. Having a PK means that we can easily change the PK into another one if needed in the future. The ones we chose might not be the best ones, but will allow us to get them changed. Bug: T172514 Change-Id: Id635297838938c7c5dfe65d45285a4d16d65152d
21 lines
No EOL
596 B
SQL
21 lines
No EOL
596 B
SQL
CREATE TABLE /*_*/langlinks_tmp (
|
|
-- page_id of the referring page
|
|
ll_from int unsigned NOT NULL default 0,
|
|
|
|
-- Language code of the target
|
|
ll_lang varbinary(20) NOT NULL default '',
|
|
|
|
-- Title of the target, including namespace
|
|
ll_title varchar(255) binary NOT NULL default '',
|
|
PRIMARY KEY (ll_from,ll_lang)
|
|
) /*$wgDBTableOptions*/;
|
|
|
|
INSERT INTO /*_*/langlinks_tmp
|
|
SELECT * FROM /*_*/langlinks;
|
|
|
|
DROP TABLE /*_*/langlinks;
|
|
|
|
ALTER TABLE /*_*/langlinks_tmp RENAME TO /*_*/langlinks;
|
|
|
|
-- Index for ApiQueryLangbacklinks
|
|
CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); |