CREATE TABLE IF NOT EXISTS NUE_INDEX_TAG_CATEGORY
(
	NAME		VARCHAR(255)					NOT NULL				COMMENT 'タグ名',
	SORT		SMALLINT UNSIGNED				NOT NULL	DEFAULT 0	COMMENT 'ソート優先度',
	ENTITY_ID	CHAR(36) CHARACTER SET ascii	NOT NULL				COMMENT '実体ID',
	PRIMARY KEY (NAME),
	FOREIGN KEY (NAME) REFERENCES NUE_INDEX_TAG(NAME) ON UPDATE CASCADE ON DELETE CASCADE,
	FOREIGN KEY (ENTITY_ID) REFERENCES NUE_ENTITIES(ID) ON UPDATE CASCADE ON DELETE CASCADE
)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='カテゴリタグ索引';
