DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(40)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
SHOW CREATE TABLE diaries;
Table	Create Table
diaries	CREATE TABLE `diaries` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
INSERT INTO diaries (title) VALUES ("survey");
SELECT * FROM diaries;
id	title
1	survey
ALTER TABLE diaries
ADD COLUMN body VARCHAR(140) FIRST,
ADD COLUMN published BOOLEAN AFTER id,
ADD COLUMN created_at DATETIME;
UPDATE diaries SET body = "will start groonga!";
SELECT * FROM diaries;
body	id	published	title	created_at
will start groonga!	1	0	survey	1970-01-01 00:00:00
INSERT INTO diaries (title, body, published, created_at)
VALUES ("groonga (1)", "starting groonga...", TRUE, "2014-2-9 02:09:00");
INSERT INTO diaries (title, body, published, created_at)
VALUES ("groonga (2)", "started groonga.", FALSE, "2014-2-9 12:19:00");
SELECT * FROM diaries;
body	id	published	title	created_at
will start groonga!	1	0	survey	1970-01-01 00:00:00
starting groonga...	2	1	groonga (1)	2014-02-09 02:09:00
started groonga.	3	0	groonga (2)	2014-02-09 12:19:00
SHOW CREATE TABLE diaries;
Table	Create Table
diaries	CREATE TABLE `diaries` (
  `body` varchar(140) DEFAULT NULL,
  `id` int NOT NULL AUTO_INCREMENT,
  `published` tinyint DEFAULT NULL,
  `title` varchar(40) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Mroonga AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
DROP TABLE diaries;
