/*****************************************************************************
*
* Filename         - $Workfile:   bpm_data.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_data table and associated items
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   bpm_data.sql  $  $Revision:   1.3  $
*
* 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/bpm_data.svl  $
 * 
 *    Rev 1.3   21 Jun 2001 14:46:48   tagtrak
 * OR:
 * CR:
 * Re-baseline version 4.0.0 to include patches.
 * 
 *    Rev 1.2   02 Apr 1998 19:42:32   tagtrak
 * OR:
 * CR:
 * REV:
 * Initial Issue
 * See label for concession
 * 
 *    Rev 1.1   26 Feb 1998 11:07:28   tagtrak
 * OR:
 * CR:
 * REV:
 * Initial core product version
 * 
 *    Rev 1.0   22 Oct 1997 11:07:26   tagtrak
 * OR:
 * CR:
 * REV:
 * Initial check-in
*
****************************************************************************/

PROMPT Creating table BPM_DATA;

create table BPM_DATA (
   BPMID                         number(10) NOT NULL,
   PAX_ID                        number(10) NOT NULL,
   BAG_TAG                       char(10) NOT NULL,
   USER_ID                       number(10) default 0,
   SCAN_TIME                     date 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_data add ( constraint bpm_data_pk primary key (appn_row_id) using index tablespace &1._indexes);

create index BPM_DATA_SK1 on BPM_DATA(BPMID) tablespace &1._indexes;

COMMENT ON TABLE BPM_DATA IS 'This table contains details of the BPMs in the system';

COMMENT ON COLUMN BPM_DATA.BAG_TAG IS  'The ten digit bag tag number';
COMMENT ON COLUMN BPM_DATA.BPMID IS  'The BPM identifier';
COMMENT ON COLUMN BPM_DATA.PAX_ID IS  'The passenger identifier';
COMMENT ON COLUMN BPM_DATA.SCAN_TIME IS  'The scan time';
COMMENT ON COLUMN BPM_DATA.USER_ID IS  'The user identifier';
COMMENT ON COLUMN BPM_DATA.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN BPM_DATA.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN BPM_DATA.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN BPM_DATA.CUSER IS 'The user who created the row';
COMMENT ON COLUMN BPM_DATA.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN BPM_DATA.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN BPM_DATA.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN BPM_DATA.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN BPM_DATA.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
