1 CREATE TABLE forum_mysqlftsindex (
2 id int NOT NULL AUTO_INCREMENT,
3 node_id int NOT NULL UNIQUE,
4 body longtext NOT NULL,
6 FOREIGN KEY (node_id) REFERENCES forum_node (id) ON UPDATE CASCADE ON DELETE CASCADE,
10 ALTER TABLE forum_mysqlftsindex CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
14 CREATE TRIGGER fts_on_insert AFTER INSERT ON forum_node
17 INSERT INTO forum_mysqlftsindex (node_id, body) VALUES (NEW.id, UPPER(CONCAT_WS('\n', NEW.title, NEW.body, NEW.tagnames)));
23 CREATE TRIGGER fts_on_update AFTER UPDATE ON forum_node
26 UPDATE forum_mysqlftsindex SET body = UPPER(CONCAT_WS('\n', NEW.title, NEW.body, NEW.tagnames)) WHERE node_id = NEW.id;
31 INSERT INTO forum_mysqlftsindex (node_id, body) SELECT id, UPPER(CONCAT_WS('\n', title, body, tagnames)) FROM forum_node;