Skip to content

Commit 3a975cb

Browse files
authored
Fix schema for IBM DB2 support (#10)
* IBM DB2 requires primary keys to be declared as not null. * IBM DB2 does not support "serial" type. Changed to the standard SQL "identity" type that is supported by DB2 11.5, PostgreSQL 10, HSQLDB, etc.
1 parent c9eea91 commit 3a975cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/resources/db/schema.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ create table account (
1313
);
1414

1515
create table cashaccount (
16-
id int,
16+
id int not null,
1717
number varchar(80) not null,
1818
username varchar(80) not null,
1919
availablebalance double precision,
@@ -22,7 +22,7 @@ create table cashaccount (
2222
);
2323

2424
create table creditaccount(
25-
id int,
25+
id int not null,
2626
number varchar(80) not null,
2727
username varchar(80) not null,
2828
description varchar(80) not null,
@@ -33,7 +33,7 @@ create table creditaccount(
3333

3434

3535
create table transfer(
36-
id serial,
36+
id int generated always as identity not null,
3737
fromAccount varchar(80) not null,
3838
toAccount varchar(80) not null,
3939
description varchar(80) not null,
@@ -45,7 +45,7 @@ create table transfer(
4545
);
4646

4747
create table transaction(
48-
id serial,
48+
id int generated always as identity not null,
4949
date TIMESTAMP,
5050
description varchar(80) not null,
5151
number varchar(80) not null,

0 commit comments

Comments
 (0)