CangeType addColumn and renameColum with db2 not working

Hello,
addColumn and renameColum generate incorrect SQL statements for DB2.
is: “ALTER TABLE orders ADD requested_date DATE NOT NULL”
should: “ALTER TABLE orders ADD COLUMN requested_date DATE NOT NULL”

is: “RENAME table_name TO table_name_new”
should: “RENAME TABLE table_name TO table_name_new”

Thanks,

Lina

Sorryy for the question. I’ve already cleared everything up.

Before “ALTER TABLE” see if TABLE is empty, new COLUMN is “not null” but TABLE can have data. If TABLE not empty use "ALTER TABLE orders ADD COLUMN requested_date DATE NOT NULL Default CURRENT_DATE or simular

For “RENAME TABLE” use “CREATE TABLE table_name_new AS SELECT * FROM table_name”

1 Like

Thanks for answering @marino.cezario !