In Chapter 3 code, the primary key has to be added else it fails
create table if not exists Ingredient (
id varchar(4) not null primary key,
name varchar(25) not null,
type varchar(10) not null
);
Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException:
Failed to execute SQL script statement #6 of URL [file:/C:/Users/mrigank.ballabh/source/repos/spring-in-action-6-samples/ch03/tacos-jdbctemplate/target/classes/schema.sql]: alter table Ingredient_Ref add foreign key (ingredient) references Ingredient(id); nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Constraint "PRIMARY KEY | UNIQUE (ID)" not found;
In Chapter 3 code, the primary key has to be added else it fails create table if not exists Ingredient ( id varchar(4) not null primary key, name varchar(25) not null, type varchar(10) not null );