/*****************************************************************************
*
* Filename         - $Workfile:   cabin_classes.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history.
* Last Update      - See revision history.
*
* Project Name     - TAGTRAK(Oracle database)
*
* Source Code
* Identifier       - 
*
* Design Spec
* Section          -
*
* Contents         - Live schema class_list table definition
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2006
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   cabin_classes.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:     $
*    Rev 1.0 02 Nov 2006 robert.cooke
* CA:2102
* DESC: New tables for storing cabin class list in database
*
*****************************************************************************/

PROMPT Creating Table CABIN_CLASSES

create table CABIN_CLASSES (
   CABIN_CLASS                   VARCHAR2(1) not null,
   DESCRIPTION                   VARCHAR2(30) 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 cabin_classes add ( constraint cabin_classes_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table CABIN_CLASSES add constraint CABIN_CLASSES_UK1 UNIQUE (CABIN_CLASS) using index tablespace &1._indexes;

COMMENT ON TABLE CABIN_CLASSES IS 'This table contains details of the cabin classes used by the system';

COMMENT ON COLUMN CABIN_CLASSES.CABIN_CLASS IS  'The cabin class';
COMMENT ON COLUMN CABIN_CLASSES.DESCRIPTION IS  'Description of the cabin class';
COMMENT ON COLUMN CABIN_CLASSES.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN CABIN_CLASSES.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN CABIN_CLASSES.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN CABIN_CLASSES.CUSER IS 'The user who created the row';
COMMENT ON COLUMN CABIN_CLASSES.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN CABIN_CLASSES.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN CABIN_CLASSES.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN CABIN_CLASSES.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN CABIN_CLASSES.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
