DROP TABLE IF EXISTS diaries, memos;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
body TEXT,
FULLTEXT INDEX title_index (title),
FULLTEXT INDEX body_index (body)
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE diaries;
Table	Create Table
diaries	CREATE TABLE `diaries` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text,
  `body` text,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `title_index` (`title`),
  FULLTEXT KEY `body_index` (`body`)
) ENGINE=mroonga DEFAULT CHARSET=utf8
INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!");
SELECT * FROM diaries;
id	title	body
1	survey	will start groonga!
SELECT * FROM diaries
WHERE MATCH(title) AGAINST("groonga") AND
MATCH(body) AGAINST("starting");
id	title	body
ALTER TABLE diaries RENAME memos;
SELECT * FROM memos;
id	title	body
1	survey	will start groonga!
SELECT * FROM memos
WHERE MATCH(title) AGAINST("groonga") AND
MATCH(body) AGAINST("starting");
id	title	body
SHOW CREATE TABLE memos;
Table	Create Table
memos	CREATE TABLE `memos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` text,
  `body` text,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `title_index` (`title`),
  FULLTEXT KEY `body_index` (`body`)
) ENGINE=mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8
DROP TABLE memos;
