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

PROMPT Creating table BPM_GROUPS;

create table bpm_groups (
   id                            char(1) not null,
   description	                 varchar2(80) not null,
   bpm_types                     varchar2(20) default '' not null,
   exceptions                    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 bpm_groups add ( constraint bpm_groups_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table bpm_groups add ( constraint bpm_groups_uk1 unique (id) using index tablespace &1._indexes);

COMMENT ON TABLE BPM_GROUPS IS 'This table contains details of the different types of BPM that can be sent';

COMMENT ON COLUMN BPM_GROUPS.ID IS  'A single letter identifier for this BPM group';
COMMENT ON COLUMN BPM_GROUPS.DESCRIPTION IS  'Human readable description of the BPM type';
COMMENT ON COLUMN BPM_GROUPS.BPM_TYPES IS  'The BPM types making up this group';
COMMENT ON COLUMN BPM_GROUPS.EXCEPTIONS IS  'Whether this BPM group needs to do additional checking if used against a bag with an exception code';
COMMENT ON COLUMN BPM_GROUPS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN BPM_GROUPS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN BPM_GROUPS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN BPM_GROUPS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN BPM_GROUPS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN BPM_GROUPS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN BPM_GROUPS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN BPM_GROUPS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN BPM_GROUPS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
