Create Table midprojects_producttype (
Id int (10) Not null auto_increment primary key,
Name varchar (50 ),
Description varchar (50 ),
Orderid int
);
Create Table location_desc (
Id int (10) Not null primary key,
Location_id int not null,
Location_name varchar (50) not null,
Location_desc varchar (50)
);
Create Table midprojects_p_location (
Id int (10) Not null auto_increment primary key,
Projectname varchar (50) not null,
Location_id int,
Foreign key (location_id) References location_desc (ID)
);
Create Table midprojects_p_detail (
Id int (10) Not null auto_increment primary key,
Producttype_id int not null,
P_location_id int (10) Not null,
Bu_id int (10) Not null,
Process_type_id int (10) Not null,
P_stage_id int (10) Not null,
Foreign key (producttype_id) References midprojects_p_producttype (ID ),
Foreign key (p_location_id) References midprojects_p_location (ID ),
Foreign key (bu_id) References midprojects_p_bu (ID ),
Foreign key (process_type_id) References midprojects_p_process_type (ID ),
Foreign key (p_stage_id) References midprojects_p_stage (ID)
);
Create Table stage_desc (
Id int (10) Not null auto_increment primary key,
Stage_name varchar (50) not null,
Stage_desc varchar (50)
);
Create Table midprojects_p_stage (
Id int (10) Not null auto_increment primary key,
Stage_id int (10) Not null,
Updatetime date not null,
Enddatetime date not null,
Foreign key (stage_id) References stage_desc (ID)
);