/*****************************************************************************
*
* Filename         - $Workfile:   airport_configuration.sql  $
*
*                     Name              Date      Version     CR Number
*                     Martin Helliwell 5/8/2       1.0          15644
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          - 
*
* Contents         - Live Schema: airport_configuration table 
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2002
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   airport_configuration.sql  $  $Revision:   1.0  $
*
* 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/airport_configuration.svl  $
*
*
*****************************************************************************/

PROMPT Creating Table AIRPORT_CONFIGURATION

CREATE TABLE airport_configuration (
   airport_code                  char(3) not null, 
   security_clearance            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 airport_configuration add ( constraint airport_configuration_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table airport_configuration add ( constraint airport_configuration_uk1 unique (airport_code) using index tablespace &1._indexes);

alter table airport_configuration add constraint airport_configuration_ch check ( security_clearance in ('Y','N'));

COMMENT ON TABLE AIRPORT_CONFIGURATION IS 'This table contains screening requirements for flights outbound from each airport';

COMMENT ON COLUMN AIRPORT_CONFIGURATION.AIRPORT_CODE IS  'The code for the airport';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.SECURITY_CLEARANCE IS  'The security status for the airport';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.CUSER IS 'The user who created the row';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN AIRPORT_CONFIGURATION.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
