-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98c5c5d
commit f3981ca
Showing
3 changed files
with
650 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
drop schema if exists `computer-database-db`; | ||
create schema if not exists `computer-database-db`; | ||
use `computer-database-db`; | ||
|
||
drop table if exists computer; | ||
drop table if exists company; | ||
|
||
create table company ( | ||
id bigint not null auto_increment, | ||
name varchar(255), | ||
constraint pk_company primary key (id)) | ||
; | ||
|
||
create table computer ( | ||
id bigint not null auto_increment, | ||
name varchar(255), | ||
introduced timestamp NULL, | ||
discontinued timestamp NULL, | ||
company_id bigint default NULL, | ||
constraint pk_computer primary key (id)) | ||
; | ||
|
||
alter table computer add constraint fk_computer_company_1 foreign key (company_id) references company (id) on delete restrict on update restrict; | ||
create index ix_computer_company_1 on computer (company_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#----------------------------------- | ||
#USER RIGHTS MANAGEMENT | ||
#----------------------------------- | ||
CREATE USER 'admincdb'@'localhost' IDENTIFIED BY 'qwerty1234'; | ||
|
||
GRANT ALL PRIVILEGES ON `computer-database-db`.* TO 'admincdb'@'localhost' WITH GRANT OPTION; | ||
|
||
|
||
FLUSH PRIVILEGES; |
Oops, something went wrong.