 
 -- Configuration for appender - logger.
 INSERT INTO REFERENCES (LOGGER_ID, APPENDER_REF_ID)
-  VALUES (PREVIOUS VALUE FOR LOGGER_ID_SEQ, 1);
-
+  VALUES (0, 1);
+

CREATE OR REPLACE PUBLIC ALIAS LOGS FOR TABLE LOGS;

COMMENT ON PUBLIC ALIAS LOGS IS 'log4db2 logs';

/**
 * Sequence for the logger names in the tables CONF_LOGGERS and
 * CONF_LOGGERS_EFFECTIVE.
 */
CREATE OR REPLACE SEQUENCE LOGGER_ID_SEQ
  AS SMALLINT
  START WITH 0;

COMMENT ON SEQUENCE LOGGER_ID_SEQ IS 'Consecutive IDs for each logger';

-- Global configuration.
-- checkHierarchy: Checks the logger hierarchy.


-- Root logger.
INSERT INTO CONF_LOGGERS (LOGGER_ID, NAME, PARENT_ID, LEVEL_ID)
  VALUES (0, 'ROOT', NULL, 3);

-- Root logger in effective, it cannot be deleted after.
INSERT INTO CONF_LOGGERS_EFFECTIVE (LOGGER_ID, LEVEL_ID, HIERARCHY)
  VALUES (0, 3, '0');

-- Basic appenders.
INSERT INTO APPENDERS (APPENDER_ID, NAME)
