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

PROMPT Creating table TIMEZONE

CREATE TABLE TIMEZONE ( 
   AIRPORT_CODE                  CHAR (3)      NOT NULL, 
   OFFSET                        NUMBER (5,3)  NOT NULL, 
   UTC_OFFSET                    NUMBER (3)    NOT NULL, 
   DAYLIGHT_SAVING_BEGINS        DATE, 
   DAYLIGHT_SAVING_ENDS          DATE, 
   DAYLIGHT_SAVING_OFFSET        NUMBER, 
   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 timezone add ( constraint timezone_pk primary key (appn_row_id) using index tablespace &1._indexes);

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

COMMENT ON TABLE TIMEZONE IS 'This table contains details of timezones and time change information for each airport';

COMMENT ON COLUMN TIMEZONE.AIRPORT_CODE IS  'Airport code';
COMMENT ON COLUMN TIMEZONE.DAYLIGHT_SAVING_BEGINS IS  'Date that daylight saving begins';
COMMENT ON COLUMN TIMEZONE.DAYLIGHT_SAVING_ENDS IS  'Date that daylight saving ends';
COMMENT ON COLUMN TIMEZONE.DAYLIGHT_SAVING_OFFSET IS  'Daylight saving offset';
COMMENT ON COLUMN TIMEZONE.OFFSET IS  'Offset';
COMMENT ON COLUMN TIMEZONE.UTC_OFFSET IS  'UTC offset';
COMMENT ON COLUMN TIMEZONE.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN TIMEZONE.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN TIMEZONE.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN TIMEZONE.CUSER IS 'The user who created the row';
COMMENT ON COLUMN TIMEZONE.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN TIMEZONE.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN TIMEZONE.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN TIMEZONE.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN TIMEZONE.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
