[BAEL-3841] put back the *.sql initialisation files

This commit is contained in:
Adrian Maghear 2020-06-07 12:28:32 +02:00
parent d85c4371fb
commit 32d6f7df6c
3 changed files with 35 additions and 0 deletions

View File

@ -67,6 +67,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> </dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.10.10</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.data</groupId> <groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId> <artifactId>spring-data-commons</artifactId>

View File

@ -0,0 +1,7 @@
INSERT INTO CUSTOMER VALUES(1001,'BAELDUNG');
INSERT INTO ITEM VALUES(10001,'ITEM1',50.0);
INSERT INTO ITEM VALUES(10002,'ITEM2',100.0);
INSERT INTO ORDERDETAIL VALUES(300001,1001,10001,2);
INSERT INTO ORDERDETAIL VALUES(300002,1001,10002,5);

View File

@ -0,0 +1,23 @@
DROP TABLE ORDERDETAIL IF EXISTS;
DROP TABLE ITEM IF EXISTS;
DROP TABLE CUSTOMER IF EXISTS;
CREATE TABLE CUSTOMER(
CUSTOMERID INT PRIMARY KEY,
CUSTOMERNAME VARCHAR(250) NOT NULL
);
CREATE TABLE ITEM(
ITEMID INT PRIMARY KEY,
ITEMDESC VARCHAR(250),
PRICE DOUBLE
);
CREATE TABLE ORDERDETAIL(
ORDERID INT PRIMARY KEY,
CUSTOMERID INT NOT NULL,
ITEMID INT NOT NULL,
QUANTITY INT,
FOREIGN KEY (customerid) references CUSTOMER(customerid),
FOREIGN KEY (itemid) references ITEM(itemid)
);