报错信息如下:ErrorCode:1005Can'tcreatetable'.\thims\uim_role_right.frm'(errno:150)(0mstaken)SQL语句如下:createtableUIM_ROLE_RIGHT(UIM_IDint(4)auto_increment,--关系编号U...
报错信息如下:
Error Code : 1005
Can't create table '.\thims\uim_role_right.frm' (errno: 150)
(0 ms taken)
SQL语句如下:
create table UIM_ROLE_RIGHT(
UIM_ID int(4) auto_increment , -- 关系编号
UIM_RoleID varchar(20) not null , -- 角色编号
UIM_RightID varchar(20) not null , -- 权限变化
primary key (UIM_ID) ,
foreign key (UIM_RoleID) references UIM_ROLE(UIM_ID) on delete cascade on update cascade ,
foreign key (UIM_RightID) references UIM_RIGHT(UIM_ID) on delete cascade on update cascade
);
UIM_ROLE表如下:
create table UIM_ROLE(
UIM_ID int(4) auto_increment, -- 角色主键
UIM_RoleName varchar(20) , -- 角色姓名
primary key(UIM_ID)
);
UIM_RIGHT表如下:
create table UIM_RIGHT(
UIM_ID int(4) auto_increment , -- 权限主键
UIM_RightKey varchar(20) not null unique, -- 权限字
UIM_RightName varchar(20) , -- 权限名
primary key(UIM_ID)
);
展开