/*****************************************************************************
*
* Filename         - $Workfile:   flight_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: flight_configuration table 
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2002
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   flight_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/flight_configuration.svl  $
*
*
*****************************************************************************/

PROMPT Creating table FLIGHT_CONFIGURATION

CREATE TABLE flight_configuration (
   flight_no                     CHAR(8) NOT NULL,
   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 flight_configuration add ( constraint flight_configuration_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table flight_configuration add ( constraint flight_configuration_uk1 unique (flight_no) using index tablespace &1._indexes);

alter table flight_configuration add constraint flight_configuration_ch check ( security_clearance in ('Y','N'));

COMMENT ON TABLE FLIGHT_CONFIGURATION IS 'This table contains screening requirements for inbound from each airport';

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