/*****************************************************************************
*
* Filename         - $Workfile:   db_config.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: db_config table and associated items
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/

PROMPT Creating table DB_CONFIG

CREATE TABLE db_config (
   db_item                       CHAR(30) NOT NULL,
   db_value                      CHAR(20) NOT NULL,
   description                   VARCHAR2(256),                  
   mws_editable                  CHAR(1) DEFAULT 'N' NOT NULL,
   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 db_config add ( constraint db_config_pk primary key (appn_row_id) using index tablespace &1._indexes);

ALTER TABLE db_config ADD ( constraint db_config_uk1 unique (db_item) using index tablespace &1._indexes);

COMMENT ON TABLE DB_CONFIG IS 'This table contains variables used to configure various database functions';

COMMENT ON COLUMN DB_CONFIG.DB_ITEM IS  'The database configuration item';
COMMENT ON COLUMN DB_CONFIG.DB_VALUE IS  'The value of the database configuration item';
COMMENT ON COLUMN DB_CONFIG.DESCRIPTION IS  'A description of the database configuration item';
COMMENT ON COLUMN DB_CONFIG.MWS_EDITABLE IS  'Indicates whether the column can be changed by the MWS.';
COMMENT ON COLUMN DB_CONFIG.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN DB_CONFIG.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN DB_CONFIG.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN DB_CONFIG.CUSER IS 'The user who created the row';
COMMENT ON COLUMN DB_CONFIG.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN DB_CONFIG.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN DB_CONFIG.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN DB_CONFIG.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN DB_CONFIG.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';

