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

PROMPT Creating table FASL_FLIGHT_INFO

create table fasl_flight_info (
   id                 	         number,
   timestamp          	         date,
   direction		         varchar2(3)  not null,
   flight_carrier     	         varchar2(3)  not null,
   flight_number                 varchar2(4)  not null,
   flight_suffix                 varchar2(1)  not null,
   flight_date		         varchar2(8)  not null, 
   std		                 varchar2(4)  not null,
   destination                   varchar2(3)  not null,
   gate                          varchar2(5),
   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 fasl_flight_info add ( constraint fasl_flight_info_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table fasl_flight_info add ( constraint fasl_flight_info_uk1 unique (id) using index tablespace &1._indexes);

alter table fasl_flight_info add ( constraint fasl_info_chk_dir check ( direction in ('ARR', 'DEP')));

COMMENT ON TABLE FASL_FLIGHT_INFO IS 'This table contains flight information received from FIDS on the SFO AODB interface.';

COMMENT ON COLUMN FASL_FLIGHT_INFO.DESTINATION IS  'Destination';
COMMENT ON COLUMN FASL_FLIGHT_INFO.DIRECTION IS  'Direction (inbound or outbound)';
COMMENT ON COLUMN FASL_FLIGHT_INFO.FLIGHT_CARRIER IS  'Flight carrier';
COMMENT ON COLUMN FASL_FLIGHT_INFO.FLIGHT_DATE IS  'Flight date';
COMMENT ON COLUMN FASL_FLIGHT_INFO.FLIGHT_NUMBER IS  'Flight number';
COMMENT ON COLUMN FASL_FLIGHT_INFO.FLIGHT_SUFFIX IS  'Flight Suffix';
COMMENT ON COLUMN FASL_FLIGHT_INFO.GATE IS  'Gate number';
COMMENT ON COLUMN FASL_FLIGHT_INFO.ID IS  'Unique identifier';
COMMENT ON COLUMN FASL_FLIGHT_INFO.STD IS  'Scheduled time of departure';
COMMENT ON COLUMN FASL_FLIGHT_INFO.TIMESTAMP IS  'Time that the row was inserted';
COMMENT ON COLUMN FASL_FLIGHT_INFO.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN FASL_FLIGHT_INFO.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN FASL_FLIGHT_INFO.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN FASL_FLIGHT_INFO.CUSER IS 'The user who created the row';
COMMENT ON COLUMN FASL_FLIGHT_INFO.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN FASL_FLIGHT_INFO.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN FASL_FLIGHT_INFO.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN FASL_FLIGHT_INFO.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN FASL_FLIGHT_INFO.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';

