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

PROMPT Creating table CREDENTIALS_LOOKUP

create table CREDENTIALS_LOOKUP (
   pax_cred                      VARCHAR2(15) DEFAULT 'SEQUENCE_NO' NOT NULL ,
   pax_cred_scanner_values       NUMBER 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 credentials_lookup add ( constraint credentials_lookup_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table credentials_lookup add ( constraint credentials_lookup_uk1 unique (pax_cred) using index tablespace &1._indexes);
 
alter table credentials_lookup add ( constraint credentials_lookup_uk2 unique (pax_cred_scanner_values) using index tablespace &1._indexes);

COMMENT ON TABLE CREDENTIALS_LOOKUP IS 'This table contains details of passenger credentials';

COMMENT ON COLUMN CREDENTIALS_LOOKUP.PAX_CRED IS  'Passenger credential';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.PAX_CRED_SCANNER_VALUES IS  'Value fot the credential on the scanner';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.CUSER IS 'The user who created the row';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN CREDENTIALS_LOOKUP.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';

