DROP DATABASE IF EXISTS mroonga;
CREATE DATABASE mroonga;
USE mroonga;
CREATE TABLE priorities (
id INT PRIMARY KEY
) DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_bin;
CREATE TABLE bugs (
id INT UNSIGNED PRIMARY KEY,
priority INT COMMENT 'type "priorities"',
INDEX bugs_priority_index (priority) COMMENT 'table "priorities"'
) DEFAULT CHARSET=utf8mb4;
INSERT INTO bugs (id, priority) VALUES (1, 10);
INSERT INTO bugs (id, priority) VALUES (2, 3);
INSERT INTO bugs (id, priority) VALUES (3, -2);
SELECT mroonga_command("dump --dump_plugins no --dump_records no");
mroonga_command("dump --dump_plugins no --dump_records no")
table_create bugs TABLE_PAT_KEY UInt32
column_create bugs id COLUMN_SCALAR UInt32

table_create mroonga_operations TABLE_NO_KEY
column_create mroonga_operations record COLUMN_SCALAR UInt32
column_create mroonga_operations table COLUMN_SCALAR ShortText
column_create mroonga_operations type COLUMN_SCALAR ShortText

table_create priorities TABLE_PAT_KEY Int32
column_create priorities id COLUMN_SCALAR Int32

column_create bugs priority COLUMN_SCALAR priorities

column_create priorities bugs_priority_index COLUMN_INDEX bugs priority
SELECT *
FROM bugs
WHERE priority = 3;
id	priority
2	3
DROP TABLE bugs;
DROP TABLE priorities;
DROP DATABASE mroonga;
