/*****************************************************************************
*
* Filename         - $Workfile:   carrier_subgroup.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: carrier_subgroup table and associated items
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   carrier_subgroup.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.
*
*
****************************************************************************/

PROMPT Creating table CARRIER_SUBGROUP

create table carrier_subgroup (
   alpha_code                    char(3) not null,
   carrier                       varchar2(40) not null,
   min_flight_no                 number(4) not null,
   max_flight_no                 number(4) 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 carrier_subgroup add ( constraint carrier_subgroup_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table carrier_subgroup add ( constraint carrier_subgroup_uk1 unique (alpha_code,min_flight_no,max_flight_no) using index tablespace &1._indexes);

alter table carrier_subgroup add ( constraint carrier_grp_fk_alpha foreign key (alpha_code) references carrier_lookup (alpha_code));

COMMENT ON TABLE CARRIER_SUBGROUP IS 'This table enables a sub range of flights numbers to be assigned to an agent';

COMMENT ON COLUMN CARRIER_SUBGROUP.ALPHA_CODE IS  'Carrier code';
COMMENT ON COLUMN CARRIER_SUBGROUP.CARRIER IS  'Carrier description';
COMMENT ON COLUMN CARRIER_SUBGROUP.MAX_FLIGHT_NO IS  'Maximum flight number';
COMMENT ON COLUMN CARRIER_SUBGROUP.MIN_FLIGHT_NO IS  'Minimum flight number ';
COMMENT ON COLUMN CARRIER_SUBGROUP.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN CARRIER_SUBGROUP.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN CARRIER_SUBGROUP.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN CARRIER_SUBGROUP.CUSER IS 'The user who created the row';
COMMENT ON COLUMN CARRIER_SUBGROUP.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN CARRIER_SUBGROUP.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN CARRIER_SUBGROUP.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN CARRIER_SUBGROUP.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN CARRIER_SUBGROUP.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
