DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`remark` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`available` INT(11) NULL DEFAULT NULL,
`createtime` DATETIME(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = INNODB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
应该为
`createtime` DATETIME DEFAULT NULL,
CREATE TABLE `sys_role_permission` (
`rid` INT(11) NOT NULL DEFAULT '0',
`pid` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`rid`,`pid`) USING BTREE,
KEY `sys_role_permission_ibfk_1` (`pid`) USING BTREE,
CONSTRAINT `sys_role_permission_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `sys_permission` (`id`) ON DELETE CASCADE,
CONSTRAINT `sys_role_permission_ibfk_2` FOREIGN KEY (`rid`) REFERENCES `sys_role` (`id`) ON DELETE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT COMMENT='InnoDB free: 9216 kB; (`pid`) REFER `warehouse/sys_permission`(`id`) ON DELETE C'
应该为
`rid` INT(11) NOT NULL DEFAULT 0,
`pid` INT(11) NOT NULL DEFAULT 0,