I have a simple Restfull app. It works. But, when I add .sql files - the app doesn't work. I add schema.sql
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
CREATE TABLE country (
id SERIAL PRIMARY KEY NOT NULL ,
county_name CHAR (30) NOT NULL UNIQUE );
CREATE TABLE city (
id SERIAL PRIMARY KEY NOT NULL ,
city_name CHAR (30) NOT NULL,
country_id INTEGER REFERENCES country,
UNIQUE (city_name, country_id));
CREATE TABLE street (
id SERIAL PRIMARY KEY NOT NULL,
street_name CHAR (30) NOT NULL,
city_id INTEGER REFERENCES city,
building_number CHAR(10),
UNIQUE (street_name, city_id));
and data.sql
INSERT INTO country (county_name) VALUES ('Ukraine');
INSERT INTO country (county_name) VALUES ('France');
INSERT INTO country (county_name) VALUES ('Italy');
INSERT INTO country (county_name) VALUES ('German');
INSERT INTO country (county_name) VALUES ('England');
application.properties
spring.jpa.database=postgresql
spring.datasource.platform=postgres
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.database.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/ubr
spring.datasource.username=postgres
spring.datasource.password=1
server.port=8080
After first run - it hasn't an error, but after second run I have a stacktrace with many exeptions. What I do wrong?