For db2 LUW 11.5 following error occurs:
Input:
create table TEST.TESTTBL
(
ID BIGINT not null,
COL_1 VARCHAR(80) not null,
COL_2 VARCHAR(160) not null,
constraint TESTTBL_PK
primary key (ID),
constraint TESTTBL_UC
unique (COL_1, COL_2)
);
CREATE Table Skripting function results in:
CREATE TABLE TESTTBL
(
ID bigint PRIMARY KEY NOT NULL,
COL_1 varchar(20) NOT NULL,
COL_2 varchar(40) NOT NULL
)
;
CREATE UNIQUE INDEX TESTTBL_UC ON TESTTBL ( COL_1,COL_2 )
;
CREATE UNIQUE INDEX TESTTBL_PK ON TESTTBL(ID)
;
The unique key TESTTBL_UC is missing.
Moreover the name of the primary key does not get scripted (TESTTBL_PK).
Please fix, thank you!
One more thing. Please implement fully qualified schema scripting for indexes and other objects, too. I activated the associated option for tables in "global preferences" --> SQL scripting but it does seem to work for tables exclusively. Thanks.