/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2008 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR CONTINUE ROLLBACK

CREATE TABLE XXAS_PERF_PLANS
  (perf_plan_id            number              PRIMARY KEY
  ,title                   varchar2(400 char)  NOT NULL
  ,start_date              date                NOT NULL
  ,end_date                date                NOT NULL
  ,status_code             varchar2(30)        NOT NULL
  ,enrollment_formula_name varchar2(80)        NOT NULL
  ,created_by              number              NOT NULL
  ,creation_date           date                NOT NULL
  ,last_update_date        date                NOT NULL
  ,last_updated_by         number              NOT NULL
  ,last_update_login       number              NOT NULL);

ALTER TABLE XXAS_PERF_PLANS ADD (goal_rating_scale_id number);

ALTER TABLE XXAS_PERF_PLANS ADD(icon_name   varchar2(80)   DEFAULT 'starfilled'
                               ,icon_color  varchar2(2000) DEFAULT 'energized'
                               );
                               
ALTER TABLE XXAS_PERF_PLANS ADD(goal_rating_lookup_type        varchar2(30) DEFAULT 'XXAS_GOAL_REVIEW_RATING'
                               ,competency_rating_lookup_type  varchar2(30) DEFAULT 'XXAS_GOAL_REVIEW_RATING'
                               );

GRANT ALL ON XXAS_PERF_PLANS TO &1 WITH GRANT OPTION;

COMMIT; 
EXIT;
