Hello everyone!
I'm trying to get a unique constraint (airline_static_id) to be added to my
Oracle table during creation but for some reason, it does not appear to get
added I see no SQL commands adding it or specifying it in the CREATE
statement, and I can violate the constraint in the resulting database
without anything stopping me.
My schema and the SQL commands executed by DdlUtils are listed below. I'm
using DdlUtils version 1.0. I must be missing something, but what could it
be?
Regards,
Robert
<table name="tbl_workstation">
<column name="id" primaryKey="true" required="false" type="DECIMAL"
size="6" autoIncrement="true"/>
<column name="wsid" primaryKey="false" required="false" type="VARCHAR"
size="20" autoIncrement="false"/>
<column name="airline_static_id" primaryKey="false" required="false"
type="VARCHAR" size="15" autoIncrement="false"/>
<index name="ws_id_idx">
<index-column name="id"/>
</index>
<index name="ws_asi_idx">
<index-column name="airline_static_id"/>
</index>
<unique>
<unique-column name="id"/>
<unique-column name="wsid"/>
<unique-column name="airline_static_id"/>
</unique>
</table>
22:02:59 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - About
to execute SQL CREATE TABLE tbl_workstation
(
id NUMBER(6,0) ,
wsid VARCHAR2(20),
airline_static_id VARCHAR2(15),
PRIMARY KEY (id)
)
22:02:59 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - After
execution, 0 row(s) have been changed
22:02:59 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - About
to execute SQL CREATE INDEX ws_id_idx ON tbl_workstation (id)
22:03:00 WARN org.apache.ddlutils.platform.oracle.Oracle8Platform - SQL
Command CREATE INDEX ws_id_idx ON tbl_workstation (id) failed with:
ORA-01408: such column list already indexed
22:03:00 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform -
java.sql.SQLException: ORA-01408: such column list already indexed
22:03:00 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - About
to execute SQL CREATE INDEX ws_asi_idx ON tbl_workstation
(airline_static_id)
22:03:00 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - After
execution, 0 row(s) have been changed
22:03:00 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - About
to execute SQL CREATE OR REPLACE TRIGGER trg_tbl_workstation_id BEFORE
INSERT ON tbl_workstation FOR EACH ROW WHEN (new.id IS NULL)
BEGIN SELECT seq_tbl_workstation_id.nextval INTO :new.id FROM dual; END;
22:03:00 DEBUG org.apache.ddlutils.platform.oracle.Oracle8Platform - After
execution, 0 row(s) have been changed