fixed sql DDL
This commit is contained in:
parent
5866a0a860
commit
80cd5c3de9
@ -3,44 +3,36 @@ create table users
|
|||||||
UserName varchar(50) charset utf8mb3 not null
|
UserName varchar(50) charset utf8mb3 not null
|
||||||
primary key,
|
primary key,
|
||||||
Password varchar(50) charset utf8mb3 null,
|
Password varchar(50) charset utf8mb3 null,
|
||||||
RoleID int auto_increment,
|
Role varchar(50) not null,
|
||||||
IsActive int default 1 null,
|
IsActive int default 1 null,
|
||||||
CreatedBy varchar(50) charset utf8mb3 null,
|
CreatedBy varchar(50) charset utf8mb3 null,
|
||||||
CreatedDate datetime null,
|
CreatedDate datetime null,
|
||||||
|
Email varchar(50) null,
|
||||||
|
constraint users_Email_uindex
|
||||||
|
unique (Email),
|
||||||
constraint users_UserName_uindex
|
constraint users_UserName_uindex
|
||||||
unique (UserName),
|
unique (UserName),
|
||||||
constraint users_roles_RoleID_fk
|
constraint users_roles_Role_fk
|
||||||
foreign key (RoleID) references roles (RoleID)
|
foreign key (Role) references roles (Role)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Colin ', 'Waffle', 'Jacob', '2021-12-13 04:27:42');
|
INSERT INTO hobby.users (UserName, Password, Role, IsActive, CreatedBy, CreatedDate, Email) VALUES
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Danny', 'Spartan', 'Jacob', '2021-12-13 04:29:54');
|
('Colin ', 'Waffle', 'Admin', 1, 'Jacob', '2021-12-13 04:27:42', null),
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Jacob', 'Teamhobby1234', 'SystemCreator', '2021-12-13 03:25:14');
|
('Danny', 'Spartan', 'Admin', 1, 'Jacob', '2021-12-13 04:29:54', null),
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Long', 'Joystick', 'Jacob', '2021-12-13 04:29:57');
|
('Jacob', 'Teamhobby1234', 'Admin', 1, 'SystemCreator', '2021-12-13 03:25:14', null),
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Rifat', 'ApproveDar', 'Jacob', '2021-12-13 04:29:55');
|
('Long', 'Joystick', 'regular', 1, 'Jacob', '2021-12-13 04:29:57', null),
|
||||||
|
('Rifat', 'ApproveDar', 'Admin', 1, 'Jacob', '2021-12-13 04:29:55', null);
|
||||||
|
|
||||||
|
|
||||||
create table roles
|
create table roles
|
||||||
(
|
(
|
||||||
RoleID int auto_increment
|
RoleID int not null,
|
||||||
primary key,
|
Role varchar(50) charset utf8mb3 not null,
|
||||||
Role varchar(50) charset utf8mb3 null,
|
CreatedBy varchar(200) charset utf8mb3 not null,
|
||||||
CreatedBy varchar(200) charset utf8mb3 null,
|
CreatedDate datetime not null,
|
||||||
CreatedDate datetime null
|
constraint role_pk
|
||||||
|
primary key (Role)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('Admin', 'SystemCreator', '2021-12-13 03:25:14');
|
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('Admin', 'Jacob', '2021-12-13 03:25:14');
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Colin', '2021-12-13 03:25:14');
|
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Colin', '2021-12-13 03:25:14');
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Colin', '2021-12-13 03:25:14');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:44');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:46');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:47');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:47');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:49');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:50');
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('regular', 'Jacob', '2021-12-13 03:37:51');
|
|
||||||
|
|
||||||
|
|
||||||
alter table users
|
|
||||||
add constraint users_roles_RoleID_fk
|
|
||||||
foreign key (RoleID) references roles (RoleID);
|
|
||||||
Loading…
Reference in New Issue
Block a user