rem ----------------------------------------------------------------------------
rem File:        $RCSfile: wsgsec.sql $
rem Author:      $Author: bcopy $
rem Date:        $Date: 2001/10/30 11:41:12 $
rem Version:     $Revision: 1.2 $
rem Status:      $State: Exp $
rem Locked_by:   $Locker:  $
rem Description: <Enter global description here>
rem Notes:       <Global notes>
rem RealAuth:    <Full real name of code author>
rem IncepDate:   <nnth Xxxember 1998>
rem Copyright:   (c) Oracle Corporation 1998.  All Rights Reserved.
rem ----------------------------------------------------------------------------
rem Log of Changes from RCS
rem ----------------------------------------------------------------------------
rem $Log: wsgsec.sql $
rem Revision 1.2  2001/10/30  11:41:12  bcopy
rem B1956579 : Added comments to update wsgp.pkb when session table changes.
rem
rem Revision 1.1  1998/11/06  14:54:36  ipenning
rem Initial revision
rem
rem ----------------------------------------------------------------------------
rem  

PROMPT Creating Table 'WSGSEC_USERRESP' 
CREATE TABLE WSGSEC_USERRESP
 (RESPONSIBILITY_NAME  VARCHAR2(30) NOT NULL
 ,USER_NAME  VARCHAR2(30) NOT NULL
 )
/

PROMPT Creating Table 'WSGSEC_USER' 
CREATE TABLE WSGSEC_USER
 (USER_NAME  VARCHAR2(30) NOT NULL
 ,PASSWORD  VARCHAR2(30) NOT NULL
 )
/

PROMPT Creating Table 'WSGSEC_PERM' 
CREATE TABLE WSGSEC_PERM
 (RESPONSIBILITY_NAME  VARCHAR2(30) NOT NULL
 ,PACKAGE_NAME  VARCHAR2(30) NOT NULL
 )
/

rem B1956579 : Update WSGP.PKB when changing CLIENT_ID data type
PROMPT Creating Table 'WSGSEC_SESSIONS' 
CREATE TABLE WSGSEC_SESSIONS
 (CLIENT_ID  VARCHAR2(240) NOT NULL
 ,USER_NAME  VARCHAR2(30) NOT NULL
 ,IP_ADDRESS  VARCHAR2(30) NOT NULL
 ,EXPIRES  DATE
 )
/

PROMPT Creating Table 'WSGSEC_RESP' 
CREATE TABLE WSGSEC_RESP
 (RESPONSIBILITY_NAME  VARCHAR2(30) NOT NULL
 )
/

PROMPT Creating Primary Key on 'WSGSEC_USERRESP'
ALTER TABLE WSGSEC_USERRESP ADD CONSTRAINT
 WSGSEC_USERRESP_PK PRIMARY KEY 
  (RESPONSIBILITY_NAME
  ,USER_NAME)
/

PROMPT Creating Primary Key on 'WSGSEC_USER'
ALTER TABLE WSGSEC_USER ADD CONSTRAINT
 WSGSEC_USER_PK PRIMARY KEY 
  (USER_NAME)
/

PROMPT Creating Primary Key on 'WSGSEC_PERM'
ALTER TABLE WSGSEC_PERM ADD CONSTRAINT
 WSGSEC_PERM_PK PRIMARY KEY 
  (PACKAGE_NAME
  ,RESPONSIBILITY_NAME)
/


PROMPT Creating Primary Key on 'WSGSEC_SESSIONS'
ALTER TABLE WSGSEC_SESSIONS ADD CONSTRAINT
 WSGSEC_SESSIONS_PK PRIMARY KEY 
  (CLIENT_ID)
/

PROMPT Creating Primary Key on 'WSGSEC_RESP'
ALTER TABLE WSGSEC_RESP ADD CONSTRAINT
 WSGSEC_RESP_PK PRIMARY KEY 
  (RESPONSIBILITY_NAME)
/
 

PROMPT Creating Foreign Keys on 'WSGSEC_USERRESP'
ALTER TABLE WSGSEC_USERRESP ADD CONSTRAINT
 USERNAME_FK FOREIGN KEY 
  (USER_NAME) REFERENCES WSGSEC_USER
  (USER_NAME) 
 ADD CONSTRAINT
 RESPONSIBILITY_FK FOREIGN KEY 
  (RESPONSIBILITY_NAME) REFERENCES WSGSEC_RESP
  (RESPONSIBILITY_NAME)
/
 

PROMPT Creating Foreign Keys on 'WSGSEC_PERM'
ALTER TABLE WSGSEC_PERM ADD CONSTRAINT
 RESP_PERM_FK FOREIGN KEY 
  (RESPONSIBILITY_NAME) REFERENCES WSGSEC_RESP
  (RESPONSIBILITY_NAME)
/

PROMPT Installing default security package
@@wsgsec.pks
@@wsgsec.pkb
rem  
rem ----------------------------------------------------------------------------
rem $$Header_is_done
rem  End of file $RCSfile: wsgsec.sql $
rem ----------------------------------------------------------------------------
