fixed ddl
This commit is contained in:
parent
e3c3ef4b83
commit
ca51159bc6
@ -1,19 +1,13 @@
|
|||||||
create table users
|
create table users
|
||||||
(
|
(
|
||||||
UserName varchar(50) charset utf8mb3 not null
|
UserName varchar(50) charset utf8mb3 not null,
|
||||||
primary key,
|
Password varchar(50) charset utf8mb3 not null,
|
||||||
Password varchar(50) charset utf8mb3 null,
|
Role varchar(50) charset utf8mb3 not null,
|
||||||
Role varchar(50) not null,
|
IsActive int default 1 not null,
|
||||||
IsActive int default 1 null,
|
CreatedBy varchar(50) charset utf8mb3 not null,
|
||||||
CreatedBy varchar(50) charset utf8mb3 null,
|
CreatedDate datetime not null,
|
||||||
CreatedDate datetime null,
|
constraint userRole_fk foreign key (Role) references roles (Role),
|
||||||
Email varchar(50) null,
|
constraint user_pk primary key (UserName)
|
||||||
constraint users_Email_uindex
|
|
||||||
unique (Email),
|
|
||||||
constraint users_UserName_uindex
|
|
||||||
unique (UserName),
|
|
||||||
constraint users_roles_Role_fk
|
|
||||||
foreign key (Role) references roles (Role)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO hobby.users (UserName, Password, Role, IsActive, CreatedBy, CreatedDate, Email) VALUES
|
INSERT INTO hobby.users (UserName, Password, Role, IsActive, CreatedBy, CreatedDate, Email) VALUES
|
||||||
@ -34,5 +28,6 @@ create table roles
|
|||||||
primary key (Role)
|
primary key (Role)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('Admin', 'Jacob', '2021-12-13 03:25:14');
|
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Colin', '2021-12-13 03:25:14');
|
('Admin', 'Jacob', '2021-12-13 03:25:14'),
|
||||||
|
('regular', 'Colin', '2021-12-13 03:25:14');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user