-- ABS-6708

--------------- CHARACTERISTIC ----------------
ALTER TABLE CHARACTERISTIC ADD (DIALOG_ID NUMBER NULL);

COMMENT ON COLUMN CHARACTERISTIC.DIALOG_ID
  IS 'Only filled for FlexFields. For other it should be set to Null.';

DROP INDEX XAK1CHARACTERISTIC;

CREATE UNIQUE INDEX XAK1CHARACTERISTIC ON CHARACTERISTIC (DIALOG_ID ASC, CODE ASC);

CREATE INDEX XIF1CHARACTERISTIC ON CHARACTERISTIC (DIALOG_ID ASC);

ALTER TABLE CHARACTERISTIC
  ADD CONSTRAINT CHARACTERISTIC_DIALOG_ID FOREIGN KEY (DIALOG_ID)
  REFERENCES DIALOGS (DIALOG_ID);