rechecked DDL for full DB
This commit is contained in:
parent
084e0de6ec
commit
bca0875ec7
@ -29,6 +29,7 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
// Loop Admin login
|
// Loop Admin login
|
||||||
while (mainMenu is true)
|
while (mainMenu is true)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Admin Sign in
|
// Admin Sign in
|
||||||
GetCredentials credentials = new GetCredentials();
|
GetCredentials credentials = new GetCredentials();
|
||||||
Console.WriteLine("\nPlease Enter Admin Credentials " +
|
Console.WriteLine("\nPlease Enter Admin Credentials " +
|
||||||
@ -61,6 +62,21 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
"PASSWORD=Teamhobby;" +
|
"PASSWORD=Teamhobby;" +
|
||||||
"OPTION=3";
|
"OPTION=3";
|
||||||
IDataSource<string> datasource = dbFactory.getDataSource(dbType, dbInfo);
|
IDataSource<string> datasource = dbFactory.getDataSource(dbType, dbInfo);
|
||||||
|
|
||||||
|
// While loop to keep this running forever with UserManagement
|
||||||
|
// Testing archive Manager
|
||||||
|
//while (true)
|
||||||
|
//{
|
||||||
|
string currentDate = DateTime.Now.ToString("dd");
|
||||||
|
string currentTime = DateTime.Now.ToString("T");
|
||||||
|
//Console.WriteLine("Current date: {0}, Current Time: {1}", currentDate, currentTime);
|
||||||
|
if (String.Equals(currentDate, "1") && String.Equals(currentTime, "00:00:00 AM"))
|
||||||
|
{
|
||||||
|
ArchiveManager archive = new ArchiveManager(datasource);
|
||||||
|
archive.Controller();
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
|
||||||
// Create manager class from UserManagement
|
// Create manager class from UserManagement
|
||||||
SystemAccountManager manager = new SystemAccountManager();
|
SystemAccountManager manager = new SystemAccountManager();
|
||||||
|
|
||||||
@ -82,22 +98,6 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* // While loop to keep this running forever with UserManagement
|
|
||||||
// Testing archive Manager
|
|
||||||
//while (true)
|
|
||||||
//{
|
|
||||||
string currentDate = DateTime.Now.ToString("dd");
|
|
||||||
string currentTime = DateTime.Now.ToString("T");
|
|
||||||
Console.WriteLine("Current date: {0}, Current Time: {1}", currentDate, currentTime);
|
|
||||||
if (String.Equals(currentDate, "1") && String.Equals(currentTime, "00:00:00 AM"))
|
|
||||||
{
|
|
||||||
ArchiveManager archive = new ArchiveManager(datasource);
|
|
||||||
archive.Controller();
|
|
||||||
}
|
|
||||||
//}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Creating the folder Archive
|
//Creating the folder Archive
|
||||||
//Console.WriteLine("Creating a new folder ...");
|
//Console.WriteLine("Creating a new folder ...");
|
||||||
//archive.CreateArchiveFolder();
|
//archive.CreateArchiveFolder();
|
||||||
@ -127,8 +127,6 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
//sqlDS.RemoveEntries();
|
//sqlDS.RemoveEntries();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 2.Inserting Data into the database:
|
// 2.Inserting Data into the database:
|
||||||
//string sqlWrite = "INSERT into log(lvname, catname, userop, logmessage) values " +
|
//string sqlWrite = "INSERT into log(lvname, catname, userop, logmessage) values " +
|
||||||
// "('Info', 'View', 'Testing DAL stuffs', 'new DAL method tested');";
|
// "('Info', 'View', 'Testing DAL stuffs', 'new DAL method tested');";
|
||||||
|
|||||||
@ -34,4 +34,4 @@ INSERT INTO hobby.users (UserName, Password, Role, IsActive, CreatedBy, CreatedD
|
|||||||
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES
|
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES
|
||||||
('Admin', 'Jacob', '2021-12-13 03:25:14'),
|
('Admin', 'Jacob', '2021-12-13 03:25:14'),
|
||||||
('regular', 'Colin', '2021-12-13 03:25:14');
|
('regular', 'Jacob', '2021-12-13 03:25:14');
|
||||||
|
|||||||
@ -2,52 +2,44 @@ create database Hobby;
|
|||||||
|
|
||||||
use hobby;
|
use hobby;
|
||||||
|
|
||||||
|
create table roles
|
||||||
|
(
|
||||||
|
Role varchar(50) charset utf8mb3 not null,
|
||||||
|
CreatedBy varchar(200) charset utf8mb3 not null,
|
||||||
|
CreatedDate datetime not null,
|
||||||
|
constraint role_pk
|
||||||
|
primary key (Role)
|
||||||
|
);
|
||||||
|
|
||||||
create table users
|
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 not null,
|
||||||
RoleID int auto_increment,
|
Role varchar(50) charset utf8mb3 not null,
|
||||||
IsActive int default 1 null,
|
IsActive int default 1 not null,
|
||||||
CreatedBy varchar(50) charset utf8mb3 null,
|
CreatedBy varchar(50) charset utf8mb3 not null,
|
||||||
CreatedDate datetime null,
|
CreatedDate datetime not null,
|
||||||
constraint users_UserName_uindex
|
Email varchar(50) null,
|
||||||
unique (UserName),
|
constraint users_Email_uindex
|
||||||
constraint users_roles_RoleID_fk
|
unique (Email),
|
||||||
foreign key (RoleID) references roles (RoleID)
|
constraint userRole_fk
|
||||||
|
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, CreatedBy, CreatedDate) VALUES ('Danny', 'Spartan', 'Jacob', '2021-12-13 04:29:54');
|
INSERT INTO hobby.users (UserName, Password, Role, IsActive, CreatedBy, CreatedDate, Email) VALUES
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Jacob', 'Teamhobby1234', 'SystemCreator', '2021-12-13 03:25:14');
|
('Colin ', 'Waffle', 'Admin', 1, 'Jacob', '2021-12-13 04:27:42', null),
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Long', 'Joystick', 'Jacob', '2021-12-13 04:29:57');
|
('Danny', 'Spartan', 'Admin', 1, 'Jacob', '2021-12-13 04:29:54', null),
|
||||||
INSERT INTO hobby.users (UserName, Password, CreatedBy, CreatedDate) VALUES ('Rifat', 'ApproveDar', 'Jacob', '2021-12-13 04:29:55');
|
('Jacob', 'Teamhobby1234', 'Admin', 1, 'SystemCreator', '2021-12-13 03:25:14', null),
|
||||||
|
('Long', 'Joystick', 'regular', 1, 'Jacob', '2021-12-13 04:29:57', null),
|
||||||
|
('Rifat', '1234', 'Admin', 1, 'Jacob', '2021-12-13 04:29:55', null);
|
||||||
|
|
||||||
|
|
||||||
create table roles
|
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES
|
||||||
(
|
('Admin', 'Jacob', '2021-12-13 03:25:14'),
|
||||||
RoleID int auto_increment
|
('regular', 'Jacob', '2021-12-13 03:25:14');
|
||||||
primary key,
|
|
||||||
Role varchar(50) charset utf8mb3 null,
|
|
||||||
CreatedBy varchar(200) charset utf8mb3 null,
|
|
||||||
CreatedDate datetime null
|
|
||||||
);
|
|
||||||
|
|
||||||
INSERT INTO hobby.roles (Role, CreatedBy, CreatedDate) VALUES ('Admin', 'SystemCreator', '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);
|
|
||||||
|
|
||||||
SET Global innodb_file_per_table=ON;
|
SET Global innodb_file_per_table=ON;
|
||||||
-- SET GLOBAL innodb_file_format='Barracuda';
|
-- SET GLOBAL innodb_file_format='Barracuda';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user