 
 ALTER TABLE CONF_LOGGERS_EFFECTIVE ADD CONSTRAINT LOG_LOGGERS_EFF_FK_LEVELS FOREIGN KEY (LEVEL_ID) REFERENCES LEVELS (LEVEL_ID) ON DELETE CASCADE;
 
-ALTER TABLE CONF_LOGGERS_EFFECTIVE ADD CONSTRAINT LOG_LOGGERS_EFF_FK_PARENT FOREIGN KEY (PARENT_ID) REFERENCES CONF_LOGGERS_EFFECTIVE (LOGGER_ID) ON DELETE CASCADE;
+ALTER TABLE CONF_LOGGERS_EFFECTIVE ADD CONSTRAINT LOG_LOGGERS_EFF_FK_CNF_LOG FOREIGN KEY (LOGGER_ID) REFERENCES CONF_LOGGERS (LOGGER_ID) ON DELETE CASCADE;
 
 COMMENT ON TABLE CONF_LOGGERS_EFFECTIVE IS 'Configuration table for the effective logger levels';
 
 COMMENT ON CONF_LOGGERS_EFFECTIVE (
   LOGGER_ID IS 'Logger identifier',
-  NAME IS 'Hierarchy name to log',
-  PARENT_ID IS 'Parent logger id',
   LEVEL_ID IS 'Log level to register',
   HIERARCHY IS 'Comma separated numbers that represents the hierarchy'
   );


ALTER TABLE CONF_LOGGERS ADD CONSTRAINT LOG_LOGGERS_FK_LEVELS FOREIGN KEY (LEVEL_ID) REFERENCES LEVELS (LEVEL_ID) ON DELETE CASCADE;

ALTER TABLE CONF_LOGGERS ADD CONSTRAINT LOG_LOGGERS_FK_PARENT FOREIGN KEY (PARENT_ID) REFERENCES CONF_LOGGERS (LOGGER_ID) ON DELETE CASCADE;

COMMENT ON TABLE CONF_LOGGERS IS 'Configuration table for the logger levels';

  VALUES (NEXT VALUE FOR LOGGER_ID_SEQ, 'ROOT', NULL, 3);

-- Root logger in effective, it cannot be deleted after.
INSERT INTO CONF_LOGGERS_EFFECTIVE (LOGGER_ID, LEVEL_ID, HIERARCHY)
  VALUES (PREVIOUS VALUE FOR LOGGER_ID_SEQ, 3,
  CHAR(PREVIOUS VALUE FOR LOGGER_ID_SEQ));

-- Basic appenders.
