/*****************************************************************************
*
* Filename              - bag_status.sql
*
* Project Name          - UltraTrak Database
*
* Source Code Identifier - UAS/URBRS/SS/10127
*
* Description           - Table creation script for BAG_STATUS. 
*                         Lookup table, containing a list of the possible bag 
*                         statuses and their index values.
*
* Language              - Oracle PL/SQL
*
* File History          - For the development history run the Show History report in PVCS
*
* Copyright Ultra Electronics Airport Systems, 2003
*
*****************************************************************************/

PROMPT Creating table BAG_STATUS

create table bag_status (
   description                   varchar2(60) not null,
   status_no                     number(10) not null,
   agent_code                    char(5) not null,
   group_name                    char(15),
   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 bag_status add ( constraint bag_status_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table bag_status add ( constraint bag_status_uk1 unique (status_no) using index tablespace &1._indexes );

COMMENT ON TABLE BAG_STATUS IS 'This table contains bag status details';

COMMENT ON COLUMN BAG_STATUS.AGENT_CODE IS  'The agent code associated with this entry';
COMMENT ON COLUMN BAG_STATUS.DESCRIPTION IS  'Description';
COMMENT ON COLUMN BAG_STATUS.GROUP_NAME IS  'Bag group name';
COMMENT ON COLUMN BAG_STATUS.STATUS_NO IS  'Bag status number';
COMMENT ON COLUMN BAG_STATUS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN BAG_STATUS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN BAG_STATUS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN BAG_STATUS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN BAG_STATUS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN BAG_STATUS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN BAG_STATUS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN BAG_STATUS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN BAG_STATUS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
