string createAppUserTableSQL = @"CREATE TABLE Alarm ( id INT(10) UNSIGNED NOT NULL AUTOINCREMENT, title VARCHAR(128) NOT NULL, description TINYTEXT NOT NULL, status ENUM('pending','enabled','disabled','retired') NOT NULL,create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,modify_date TIMESTAMP NULL DEFAULT NULL,modify_user INT(11) NULL DEFAULT NULL,modify_reason TINYTEXT NULL DEFAULT NULL,PRIMARY KEY (`id`),INDEX `alarm_index` (`id` ASC, `title` ASC))ENGINE = InnoDB DEFAULT CHARACTER SET = utf8";
请帮助解决此问题
答案 0 :(得分:1)
(10)
)必须位于数据类型的末尾。 (但无论如何它都被忽略了。)CREATE TABLE Alarm (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
description TEXT NOT NULL,
status TEXT CHECK (status IN ('pending', 'enabled', 'disabled', 'retired')),
create_date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
modify_date TEXT,
modify_user INTEGER,
modify_reason TEXT
);
CREATE INDEX alarm_index ON Alarm(id, title);