MySQl workbench: Reverse engineer keeps failing for this certain database
Posted by:
Vi Dao
Date: April 26, 2022 02:26AM
Hello everyone, I am trying to reverse engineer a database for my assignment, and it just keep crashing after I am done with "Select objects". It just crashed, no error, no nothing. I have tries it with my friend's computer as well and the same thing happened.
I am using version MySQL workbench 8.0, v8.0.28 build 1474738 CE, community. Here are the script:
create database test1;
use test1;
create table Category
(
categoryID varchar(3) not null primary key,
categoryName varchar(30) not null,
categoryDescription varchar(300) null
);
create table Product
(
productID varchar(10) not null primary key,
productName varchar(70) not null,
productPrice int not null,
productImage varchar(30) not null,
productDetail varchar(300) null,
categoryID varchar(3) not null,
constraint fk_categoryID foreign key (categoryID) references category (categoryID)
);
create index indexprice on Product (productPrice);
create table Customer
(
customerID varchar(5) not null primary key,
customerUsername varchar(20),
customerPassword varchar(20) not null,
customerFullname varchar(30) not null,
customerAddress varchar(50) null,
customerEmail varchar(30) null,
customerPhone varchar(30) null
);
create table `Admin`
(
adminID varchar(10) not null primary key,
adminPassword varchar(20) not null,
adminFullname varchar(30) not null,
adminEmail varchar(20) not null
);
create table ItemOrder
(
itemOrderID varchar(10) not null primary key,
productID varchar(10) not null,
productAmount int not null check (productAmount>=0),
productPrice int not null,
constraint fk_productPrice foreign key (productPrice) references Product (productPrice),
constraint fk_productID foreign key (productID) references Product (productID)
);
create table `Order`
(
orderID varchar(10) not null primary key,
itemOrderID varchar(10) not null,
totalPrice int not null,
customerID varchar(5) not null,
deliveryAddress varchar(100) not null,
paymentMethod varchar(20) not null default('Tien mat') check (paymentMethod='Tien mat' 'Online'),
constraint fk_customerID foreign key (customerID) references Customer (customerID),
constraint fk_itemorderID foreign key (itemOrderID) references ItemOrder (itemOrderID)
);
create table Review
(
reviewID varchar(10) not null primary key,
productID varchar(10) not null,
starCount int(1) not null default(5) check (starCount<=5 and starCount>=0),
customerID varchar(5) not null,
commentContent varchar(150) null,
constraint fk_customerID2 foreign key (customerID) references Customer (customerID),
constraint fk_productID2 foreign key (productID) references Product (productID)
);
Any help is appreciated, I am quite new to this stuff