/*****************************************************************************
*
* Filename         - $Workfile:   msg_log.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          - 
*
* Contents         - Live Schema: msg_log table and associated items
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   msg_log.sql  $  $Revision:   1.1  $
*
* Revision History
*
* Note that user tagtrak is many users. For these users the user
* name is entered as the last line in the change description.
*
* $Log:   /pvcsarch/db_ora/db/source/live/tables/msg_log.svl  $
* 
*    Rev 1.1   21 Jun 2001 14:48:04   tagtrak
* OR:
* CR:
* Re-baseline version 4.0.0 to include patches.
* 
*    Rev 1.0   21 Sep 1999 10:46:58   tagtrak
* Initial revision
* 
*    Rev 1.0   20 Sep 1999 14:48:30   tagtrak
* Initial revision
 * 
****************************************************************************/

PROMPT Creating table MSG_LOG

create table msg_log (
   log_time                      date  default SYSDATE,
   error_level                   NUMBER(10),
   msg_text                      varchar2(80) NOT NULL,
   subsystem                     varchar2(50) NOT NULL,
   process                       varchar2(50),
   remarks                       varchar2(250),
   row_create_time               date,
   row_date_time                 date,
   cuser                         varchar2(30),
   muser                         varchar2(30),
   mterm                         varchar2(64),
   source                        varchar2(8),
   to_be_archived                varchar2(1),
   appn_row_id                   number(18) not null,
   system_id                     number(4) default 0 not null
);

alter table msg_log add ( constraint msg_log_pk primary key (appn_row_id) using index tablespace &1._indexes);

create index msg_log_SK1 on msg_log(log_time) tablespace &1._indexes;
 
COMMENT ON TABLE MSG_LOG IS 'This table contains a log of actions performed by the application';

COMMENT ON COLUMN MSG_LOG.ERROR_LEVEL IS  'Error Level';
COMMENT ON COLUMN MSG_LOG.LOG_TIME IS  'The time the message was logged';
COMMENT ON COLUMN MSG_LOG.MSG_TEXT IS  'The message text';
COMMENT ON COLUMN MSG_LOG.PROCESS IS  'The process that raised the message';
COMMENT ON COLUMN MSG_LOG.REMARKS IS  'Any comments associated with the message';
COMMENT ON COLUMN MSG_LOG.SUBSYSTEM IS  'The subsystem that raised the message';
COMMENT ON COLUMN MSG_LOG.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN MSG_LOG.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN MSG_LOG.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN MSG_LOG.CUSER IS 'The user who created the row';
COMMENT ON COLUMN MSG_LOG.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN MSG_LOG.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN MSG_LOG.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN MSG_LOG.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN MSG_LOG.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
