summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/sql/translate_tm.sql
blob: af97dc4b14550acb7f7315742b0c57609a89429a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- Since these tables only store secondary data,
-- it should be safe to drop them from time to time.
-- MediaWiki itself guarantees sure that this file is run only once.

-- Source texts
DROP TABLE IF EXISTS /*_*/translate_tms;
CREATE TABLE /*_*/translate_tms (
	tms_sid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
	-- Language code
	tms_lang varchar(20) binary NOT NULL,
	-- Lenght of the string in characters
	tms_len int unsigned NOT NULL,
	-- The actual text
	tms_text mediumblob NOT NULL,
	-- Identifier where this text came from
	tms_context mediumblob NOT NULL
) /*$wgDBTableOptions*/;

CREATE INDEX /*i*/tms_lang_len ON /*_*/translate_tms (tms_lang, tms_len);

-- Stored translations
DROP TABLE IF EXISTS /*_*/translate_tmt;
CREATE TABLE /*_*/translate_tmt (
	tmt_sid int unsigned NOT NULL,
	tmt_lang varchar(20) binary NOT NULL,
	tmt_text mediumblob NOT NULL
) /*$wgDBTableOptions*/;

CREATE UNIQUE INDEX /*i*/tmt_sid_lang ON /*_*/translate_tmt (tmt_sid, tmt_lang);

-- Fulltext search index
DROP TABLE IF EXISTS /*_*/translate_tmf;
CREATE TABLE /*_*/translate_tmf (
	tmf_sid int unsigned NOT NULL,
	tmf_text text
) ENGINE=MYISAM;

CREATE FULLTEXT INDEX /*i*/tmf_text ON /*_*/translate_tmf (tmf_text);