rem *********************************************************************
rem *                                                                   *
rem *             Copyright (c) Ultra Electronics Airport Systems       *
rem *                           All rights reserved.                    *
rem *                                                                   *
rem *********************************************************************
rem *                                                                   *
rem * Filename:             stand_setup.sql                             *
rem * Module Name:          stand_setup                                 *
rem * Subsystem Name:       tables                                      *
rem * Originating Author:   James Creegan                               *
rem * Design Reference:     FAS/BBTRK/SD/225                            *
rem *                                                                   *
rem *********************************************************************
rem *                                                                   *
rem * Description:                                                      *
rem *  Script to create the stand_setup table and its constraints       *
rem *********************************************************************
rem *                                                                   *
rem * Program Identification Array:                                     *
rem *                                                                   *
rem * "%Z%%M% VERSION %I% %E% %U%"
rem *                                                                   *
rem *********************************************************************
rem *                                                                   *
rem * Modification History:                                             *
rem *                                                                   *
rem * Rel Date/Time      Proj/Id   CA Ref/Details Of Change             *
rem * --- -------------- --------  ------------------------------------ *
rem * 1.0 28 May 03                File initially checked in            *
rem *********************************************************************/

PROMPT Creating table STAND_SETUP

CREATE TABLE stand_setup (
   terminal                      VARCHAR2(10)NOT NULL ,
   stand                         VARCHAR2(4) NOT NULL ,
   site_id                       NUMBER(10)  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 stand_setup add ( constraint stand_setup_pk primary key (appn_row_id) using index tablespace &1._indexes);

ALTER TABLE stand_setup ADD ( CONSTRAINT stand_setup_uk1 unique (stand,site_id) USING INDEX TABLESPACE &1._indexes );

COMMENT ON TABLE STAND_SETUP IS 'This table contains details of the stands';

COMMENT ON COLUMN STAND_SETUP.SITE_ID IS  'Site identifier';
COMMENT ON COLUMN STAND_SETUP.STAND IS  'Stand number';
COMMENT ON COLUMN STAND_SETUP.TERMINAL IS  'Terminal number';
COMMENT ON COLUMN STAND_SETUP.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN STAND_SETUP.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN STAND_SETUP.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN STAND_SETUP.CUSER IS 'The user who created the row';
COMMENT ON COLUMN STAND_SETUP.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN STAND_SETUP.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN STAND_SETUP.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN STAND_SETUP.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN STAND_SETUP.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';

