Skip to content

Commit

Permalink
Fix wrong MySQL DDL
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Apr 26, 2024
1 parent 17c393e commit 0c18cf0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sql/mysql/mysql.ddl.persistence.sql
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ ALTER TABLE PERSON_INSURANCE DROP foreign key P_PERSONID !

ALTER TABLE PERSON_INSURANCE DROP foreign key INS_INSID !

ALTER TABLE "ORDER1" DROP foreign key "FK1_FOR_ITEM" !
ALTER TABLE `ORDER1` DROP foreign key `FK1_FOR_ITEM` !

ALTER TABLE ORDER2 DROP foreign key FK2_FOR_ITEM !

Expand Down Expand Up @@ -742,21 +742,21 @@ ALTER TABLE PERSON_INSURANCE ADD ( CONSTRAINT P_PERSONID FOREIGN KEY (PERSON_PER

ALTER TABLE PERSON_INSURANCE ADD ( CONSTRAINT INS_INSID FOREIGN KEY (INSURANCE_INSID) references INSURANCE(INSID) ) !

DROP TABLE "ORDER1" !
CREATE TABLE "ORDER1" ("ID" INTEGER PRIMARY KEY NOT NULL, "TOTALPRICE" DOUBLE PRECISION , "FK1_FOR_ITEM" INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1!
DROP TABLE `ORDER1` !
CREATE TABLE `ORDER1` (`ID` INTEGER PRIMARY KEY NOT NULL, `TOTALPRICE` DOUBLE PRECISION , `FK1_FOR_ITEM` INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE ORDER2 !
CREATE TABLE ORDER2 (ID INTEGER PRIMARY KEY NOT NULL, totalPrice DOUBLE PRECISION , FK2_FOR_ITEM INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1!

DROP TABLE ORDER3 !
CREATE TABLE ORDER3 (ID INTEGER PRIMARY KEY NOT NULL, totalPrice DOUBLE PRECISION , FK3_FOR_ITEM INTEGER) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE "ITEM" !
CREATE TABLE "ITEM" ("ID" INTEGER PRIMARY KEY NOT NULL, "ITEMNAME" VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!
DROP TABLE `ITEM` !
CREATE TABLE `ITEM` (`ID` INTEGER PRIMARY KEY NOT NULL, `ITEMNAME` VARCHAR(255)) ENGINE=innoDB DEFAULT CHARSET=latin1!

ALTER TABLE "ORDER1" add ( constraint FK1_FOR_ITEM Foreign Key ("FK1_FOR_ITEM") references "ITEM"("ID") ) !
ALTER TABLE ORDER2 add ( constraint FK2_FOR_ITEM Foreign Key (FK2_FOR_ITEM) references "ITEM"("ID") ) !
ALTER TABLE ORDER3 add ( constraint FK3_FOR_ITEM Foreign Key (FK3_FOR_ITEM) references "ITEM"("ID") ) !
ALTER TABLE `ORDER1` add ( constraint FK1_FOR_ITEM Foreign Key (`FK1_FOR_ITEM`) references `ITEM`(`ID`) ) !
ALTER TABLE ORDER2 add ( constraint FK2_FOR_ITEM Foreign Key (FK2_FOR_ITEM) references `ITEM`(`ID`) ) !
ALTER TABLE ORDER3 add ( constraint FK3_FOR_ITEM Foreign Key (FK3_FOR_ITEM) references `ITEM`(`ID`) ) !

DROP TABLE MEMBER !
CREATE TABLE MEMBER (MEMBER_ID INTEGER NOT NULL, MEMBER_NAME VARCHAR(255), DUES SMALLINT, VERSION INTEGER, DONATION NUMERIC, CONSTRAINT PK_MEMBER PRIMARY KEY (MEMBER_ID)) ENGINE=innoDB DEFAULT CHARSET=latin1 !
Expand All @@ -765,7 +765,7 @@ DROP TABLE ACCOUNT !
CREATE TABLE ACCOUNT (ID INTEGER NOT NULL, BALANCE DOUBLE PRECISION, DEPOSIT DOUBLE PRECISION, WITHDRAW DOUBLE PRECISION, CONSTRAINT PK_ACCOUNT PRIMARY KEY (ID)) ENGINE=innoDB DEFAULT CHARSET=latin1 !

DROP TABLE PARTTIMEEMPLOYEE !
CREATE TABLE PARTTIMEEMPLOYEE (ID INT NOT NULL, FIRSTNAME VARCHAR(255) , LASTNAME VARCHAR(255), HIREDATE DATE, SALARY REAL NOT NULL, ADDRESS_ID VARCHAR(255), STATUS VARCHAR(255), FK_DEPT2 NUMERIC , FK_PROJECT INT, CONSTRAINT PK_PARTTIMEEMPLOYEE PRIMARY KEY (ID)) !
CREATE TABLE PARTTIMEEMPLOYEE (ID INT NOT NULL, FIRSTNAME VARCHAR(255) , LASTNAME VARCHAR(255), HIREDATE DATE, SALARY REAL NOT NULL, ADDRESS_ID VARCHAR(255), STATUS VARCHAR(255), FK_DEPT2 NUMERIC , FK_PROJECT INT, CONSTRAINT PK_PARTTIMEEMPLOYEE PRIMARY KEY (ID)) ENGINE=innoDB DEFAULT CHARSET=latin1 !
ALTER TABLE PARTTIMEEMPLOYEE ADD ( CONSTRAINT FK_ADDR FOREIGN KEY (ADDRESS_ID) REFERENCES ADDRESS(ID) )!

ALTER TABLE PARTTIMEEMPLOYEE ADD CONSTRAINT FK_DEPT2 FOREIGN KEY (FK_DEPT2) REFERENCES DEPARTMENT (ID) !
Expand Down

0 comments on commit 0c18cf0

Please sign in to comment.