portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r899611 [1/2] - in /portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql: create-schema.sql drop-schema.sql
Date Fri, 15 Jan 2010 12:29:13 GMT
Author: ate
Date: Fri Jan 15 12:29:13 2010
New Revision: 899611

URL: http://svn.apache.org/viewvc?rev=899611&view=rev
Log:
JS2-1024: mssql create-schema.sql is incorrect
See: http://issues.apache.org/jira/browse/JS2-1024

I've finally found the time (and need :) ) to pickup this issue.
The patches were provided by Frank Otto, but I had to adjust them a little for recent database
model chances.
Tested on MsSQL 2005, seems to be working well.
Thanks Frank for providing the patches!

Modified:
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql/drop-schema.sql

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql?rev=899611&r1=899610&r2=899611&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
Fri Jan 15 12:29:13 2010
@@ -20,7 +20,7 @@
 
 CREATE TABLE MEDIA_TYPE
 (
-    MEDIATYPE_ID INT NOT NULL,
+    MEDIATYPE_ID INTEGER NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     CHARACTER_SET VARCHAR(40),
     TITLE VARCHAR(80),
@@ -34,79 +34,79 @@
 
 CREATE TABLE CLIENT
 (
-    CLIENT_ID INT NOT NULL,
-    EVAL_ORDER INT NOT NULL,
+    CLIENT_ID INTEGER NOT NULL,
+    EVAL_ORDER INTEGER NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     USER_AGENT_PATTERN VARCHAR(128),
     MANUFACTURER VARCHAR(80),
     MODEL VARCHAR(80),
     VERSION VARCHAR(40),
-    PREFERRED_MIMETYPE_ID INT NOT NULL,
+    PREFERRED_MIMETYPE_ID INTEGER NOT NULL,
     PRIMARY KEY (CLIENT_ID)
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- MIMETYPE 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE MIMETYPE
 (
-    MIMETYPE_ID INT NOT NULL,
+    MIMETYPE_ID INTEGER NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     PRIMARY KEY (MIMETYPE_ID)
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- CAPABILITY 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE CAPABILITY
 (
-    CAPABILITY_ID INT NOT NULL,
+    CAPABILITY_ID INTEGER NOT NULL,
     CAPABILITY VARCHAR(80) NOT NULL,
     PRIMARY KEY (CAPABILITY_ID)
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- CLIENT_TO_CAPABILITY 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE CLIENT_TO_CAPABILITY
 (
-    CLIENT_ID INT NOT NULL,
-    CAPABILITY_ID INT NOT NULL
+    CLIENT_ID INTEGER NOT NULL,
+    CAPABILITY_ID INTEGER NOT NULL
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- CLIENT_TO_MIMETYPE 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE CLIENT_TO_MIMETYPE
 (
-    CLIENT_ID INT NOT NULL,
-    MIMETYPE_ID INT NOT NULL
+    CLIENT_ID INTEGER NOT NULL,
+    MIMETYPE_ID INTEGER NOT NULL
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- MEDIATYPE_TO_CAPABILITY 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE MEDIATYPE_TO_CAPABILITY
 (
-    MEDIATYPE_ID INT NOT NULL,
-    CAPABILITY_ID INT NOT NULL
+    MEDIATYPE_ID INTEGER NOT NULL,
+    CAPABILITY_ID INTEGER NOT NULL
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- MEDIATYPE_TO_MIMETYPE 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE MEDIATYPE_TO_MIMETYPE
 (
-    MEDIATYPE_ID INT NOT NULL,
-    MIMETYPE_ID INT NOT NULL
+    MEDIATYPE_ID INTEGER NOT NULL,
+    MIMETYPE_ID INTEGER NOT NULL
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- PORTLET_STATISTICS 
 -- ----------------------------------------------------------------------- 
@@ -118,10 +118,10 @@
     TIME_STAMP DATETIME,
     PAGE VARCHAR(80),
     PORTLET VARCHAR(255),
-    STATUS INT,
-    ELAPSED_TIME DECIMAL(19,0)
+    STATUS INTEGER,
+    ELAPSED_TIME BIGINT
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- PAGE_STATISTICS 
 -- ----------------------------------------------------------------------- 
@@ -132,10 +132,10 @@
     USER_NAME VARCHAR(80),
     TIME_STAMP DATETIME,
     PAGE VARCHAR(80),
-    STATUS INT,
-    ELAPSED_TIME DECIMAL(19,0)
+    STATUS INTEGER,
+    ELAPSED_TIME BIGINT
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- USER_STATISTICS 
 -- ----------------------------------------------------------------------- 
@@ -145,10 +145,10 @@
     IPADDRESS VARCHAR(80),
     USER_NAME VARCHAR(80),
     TIME_STAMP DATETIME,
-    STATUS INT,
-    ELAPSED_TIME DECIMAL(19,0)
+    STATUS INTEGER,
+    ELAPSED_TIME BIGINT
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- ADMIN_ACTIVITY 
 -- ----------------------------------------------------------------------- 
@@ -161,12 +161,12 @@
     USER_NAME VARCHAR(80),
     TIME_STAMP DATETIME,
     IPADDRESS VARCHAR(80),
-    ATTR_NAME VARCHAR(40),
-    ATTR_VALUE_BEFORE VARCHAR(80),
-    ATTR_VALUE_AFTER VARCHAR(80),
+    ATTR_NAME VARCHAR(200),
+    ATTR_VALUE_BEFORE VARCHAR(1000),
+    ATTR_VALUE_AFTER VARCHAR(1000),
     DESCRIPTION VARCHAR(128)
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- USER_ACTIVITY 
 -- ----------------------------------------------------------------------- 
@@ -178,20 +178,20 @@
     USER_NAME VARCHAR(80),
     TIME_STAMP DATETIME,
     IPADDRESS VARCHAR(80),
-    ATTR_NAME VARCHAR(40),
-    ATTR_VALUE_BEFORE VARCHAR(80),
-    ATTR_VALUE_AFTER VARCHAR(80),
+    ATTR_NAME VARCHAR(200),
+    ATTR_VALUE_BEFORE VARCHAR(1000),
+    ATTR_VALUE_AFTER VARCHAR(1000),
     DESCRIPTION VARCHAR(128)
 );
- 
+
 -- ----------------------------------------------------------------------- 
 -- FOLDER 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE FOLDER
 (
-    FOLDER_ID INT NOT NULL,
-    PARENT_ID INT,
+    FOLDER_ID INTEGER NOT NULL,
+    PARENT_ID INTEGER,
     PATH VARCHAR(240) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     TITLE VARCHAR(100),
@@ -212,7 +212,7 @@
     OWNER_PRINCIPAL VARCHAR(40),
     PRIMARY KEY (FOLDER_ID)
 );
- 
+
 CREATE INDEX IX_FOLDER_1 ON FOLDER (PARENT_ID);
 
 CREATE UNIQUE INDEX UN_FOLDER_1 ON FOLDER (PATH);
@@ -223,14 +223,14 @@
 
 CREATE TABLE FOLDER_METADATA
 (
-    METADATA_ID INT NOT NULL,
-    FOLDER_ID INT NOT NULL,
+    METADATA_ID INTEGER NOT NULL,
+    FOLDER_ID INTEGER NOT NULL,
     NAME VARCHAR(15) NOT NULL,
-    LOCALE VARCHAR(20) NOT NULL,
+    LOCALE VARCHAR(20) NULL,
     VALUE VARCHAR(100) NOT NULL,
     PRIMARY KEY (METADATA_ID)
 );
- 
+
 CREATE INDEX IX_FOLDER_METADATA_1 ON FOLDER_METADATA (FOLDER_ID);
 
 CREATE UNIQUE INDEX UN_FOLDER_METADATA_1 ON FOLDER_METADATA (FOLDER_ID, NAME, LOCALE, VALUE);
@@ -241,9 +241,9 @@
 
 CREATE TABLE FOLDER_CONSTRAINT
 (
-    CONSTRAINT_ID INT NOT NULL,
-    FOLDER_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINT_ID INTEGER NOT NULL,
+    FOLDER_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     USER_PRINCIPALS_ACL VARCHAR(120),
     ROLE_PRINCIPALS_ACL VARCHAR(120),
     GROUP_PRINCIPALS_ACL VARCHAR(120),
@@ -259,9 +259,9 @@
 
 CREATE TABLE FOLDER_CONSTRAINTS_REF
 (
-    CONSTRAINTS_REF_ID INT NOT NULL,
-    FOLDER_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINTS_REF_ID INTEGER NOT NULL,
+    FOLDER_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     PRIMARY KEY (CONSTRAINTS_REF_ID)
 );
@@ -276,9 +276,9 @@
 
 CREATE TABLE FOLDER_ORDER
 (
-    ORDER_ID INT NOT NULL,
-    FOLDER_ID INT NOT NULL,
-    SORT_ORDER INT NOT NULL,
+    ORDER_ID INTEGER NOT NULL,
+    FOLDER_ID INTEGER NOT NULL,
+    SORT_ORDER INTEGER NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     PRIMARY KEY (ORDER_ID)
 );
@@ -293,17 +293,17 @@
 
 CREATE TABLE FOLDER_MENU
 (
-    MENU_ID INT NOT NULL,
+    MENU_ID INTEGER NOT NULL,
     CLASS_NAME VARCHAR(100) NOT NULL,
-    PARENT_ID INT,
-    FOLDER_ID INT,
-    ELEMENT_ORDER INT,
+    PARENT_ID INTEGER,
+    FOLDER_ID INTEGER,
+    ELEMENT_ORDER INTEGER,
     NAME VARCHAR(100),
     TITLE VARCHAR(100),
     SHORT_TITLE VARCHAR(40),
     TEXT VARCHAR(100),
     OPTIONS VARCHAR(255),
-    DEPTH INT,
+    DEPTH INTEGER,
     IS_PATHS SMALLINT,
     IS_REGEXP SMALLINT,
     PROFILE VARCHAR(80),
@@ -323,10 +323,10 @@
 
 CREATE TABLE FOLDER_MENU_METADATA
 (
-    METADATA_ID INT NOT NULL,
-    MENU_ID INT NOT NULL,
+    METADATA_ID INTEGER NOT NULL,
+    MENU_ID INTEGER NOT NULL,
     NAME VARCHAR(15) NOT NULL,
-    LOCALE VARCHAR(20) NOT NULL,
+    LOCALE VARCHAR(20) NULL,
     VALUE VARCHAR(100) NOT NULL,
     PRIMARY KEY (METADATA_ID)
 );
@@ -341,14 +341,16 @@
 
 CREATE TABLE PAGE
 (
-    PAGE_ID INT NOT NULL,
-    PARENT_ID INT NOT NULL,
+    PAGE_ID INTEGER NOT NULL,
+    CLASS_NAME VARCHAR(100) NOT NULL,
+    PARENT_ID INTEGER NOT NULL,
     PATH VARCHAR(240) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
+    CONTENT_TYPE VARCHAR(4),
     VERSION VARCHAR(40),
     TITLE VARCHAR(100),
     SHORT_TITLE VARCHAR(40),
-    IS_HIDDEN SMALLINT NOT NULL,
+    IS_HIDDEN SMALLINT,
     SKIN VARCHAR(80),
     DEFAULT_LAYOUT_DECORATOR VARCHAR(80),
     DEFAULT_PORTLET_DECORATOR VARCHAR(80),
@@ -374,10 +376,10 @@
 
 CREATE TABLE PAGE_METADATA
 (
-    METADATA_ID INT NOT NULL,
-    PAGE_ID INT NOT NULL,
+    METADATA_ID INTEGER NOT NULL,
+    PAGE_ID INTEGER NOT NULL,
     NAME VARCHAR(15) NOT NULL,
-    LOCALE VARCHAR(20) NOT NULL,
+    LOCALE VARCHAR(20),
     VALUE VARCHAR(100) NOT NULL,
     PRIMARY KEY (METADATA_ID)
 );
@@ -392,9 +394,9 @@
 
 CREATE TABLE PAGE_CONSTRAINT
 (
-    CONSTRAINT_ID INT NOT NULL,
-    PAGE_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINT_ID INTEGER NOT NULL,
+    PAGE_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     USER_PRINCIPALS_ACL VARCHAR(120),
     ROLE_PRINCIPALS_ACL VARCHAR(120),
     GROUP_PRINCIPALS_ACL VARCHAR(120),
@@ -410,9 +412,9 @@
 
 CREATE TABLE PAGE_CONSTRAINTS_REF
 (
-    CONSTRAINTS_REF_ID INT NOT NULL,
-    PAGE_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINTS_REF_ID INTEGER NOT NULL,
+    PAGE_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     PRIMARY KEY (CONSTRAINTS_REF_ID)
 );
@@ -427,17 +429,17 @@
 
 CREATE TABLE PAGE_MENU
 (
-    MENU_ID INT NOT NULL,
+    MENU_ID INTEGER NOT NULL,
     CLASS_NAME VARCHAR(100) NOT NULL,
-    PARENT_ID INT,
-    PAGE_ID INT,
-    ELEMENT_ORDER INT,
+    PARENT_ID INTEGER,
+    PAGE_ID INTEGER,
+    ELEMENT_ORDER INTEGER,
     NAME VARCHAR(100),
     TITLE VARCHAR(100),
     SHORT_TITLE VARCHAR(40),
     TEXT VARCHAR(100),
     OPTIONS VARCHAR(255),
-    DEPTH INT,
+    DEPTH INTEGER,
     IS_PATHS SMALLINT,
     IS_REGEXP SMALLINT,
     PROFILE VARCHAR(80),
@@ -457,10 +459,10 @@
 
 CREATE TABLE PAGE_MENU_METADATA
 (
-    METADATA_ID INT NOT NULL,
-    MENU_ID INT NOT NULL,
+    METADATA_ID INTEGER NOT NULL,
+    MENU_ID INTEGER NOT NULL,
     NAME VARCHAR(15) NOT NULL,
-    LOCALE VARCHAR(20) NOT NULL,
+    LOCALE VARCHAR(20),
     VALUE VARCHAR(100) NOT NULL,
     PRIMARY KEY (METADATA_ID)
 );
@@ -475,9 +477,12 @@
 
 CREATE TABLE FRAGMENT
 (
-    FRAGMENT_ID INT NOT NULL,
-    PARENT_ID INT,
-    PAGE_ID INT,
+    FRAGMENT_ID INTEGER NOT NULL,
+    CLASS_NAME VARCHAR(100) NOT NULL,
+    PARENT_ID INTEGER,
+    PAGE_ID INTEGER,
+    FRAGMENT_STRING_ID VARCHAR(80),
+    FRAGMENT_STRING_REFID VARCHAR(80),
     NAME VARCHAR(100),
     TITLE VARCHAR(100),
     SHORT_TITLE VARCHAR(40),
@@ -486,18 +491,14 @@
     DECORATOR VARCHAR(80),
     STATE VARCHAR(10),
     PMODE VARCHAR(10),
-    LAYOUT_ROW INT,
-    LAYOUT_COLUMN INT,
+    LAYOUT_ROW INTEGER,
+    LAYOUT_COLUMN INTEGER,
     LAYOUT_SIZES VARCHAR(20),
     LAYOUT_X REAL,
     LAYOUT_Y REAL,
     LAYOUT_Z REAL,
     LAYOUT_WIDTH REAL,
     LAYOUT_HEIGHT REAL,
-    EXT_PROP_NAME_1 VARCHAR(40),
-    EXT_PROP_VALUE_1 VARCHAR(80),
-    EXT_PROP_NAME_2 VARCHAR(40),
-    EXT_PROP_VALUE_2 VARCHAR(80),
     OWNER_PRINCIPAL VARCHAR(40),
     PRIMARY KEY (FRAGMENT_ID)
 );
@@ -506,15 +507,19 @@
 
 CREATE INDEX UN_FRAGMENT_1 ON FRAGMENT (PAGE_ID);
 
+CREATE INDEX IX_FRAGMENT_2 ON FRAGMENT (FRAGMENT_STRING_REFID);
+
+CREATE INDEX IX_FRAGMENT_3 ON FRAGMENT (FRAGMENT_STRING_ID);
+
 -- ----------------------------------------------------------------------- 
 -- FRAGMENT_CONSTRAINT 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE FRAGMENT_CONSTRAINT
 (
-    CONSTRAINT_ID INT NOT NULL,
-    FRAGMENT_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINT_ID INTEGER NOT NULL,
+    FRAGMENT_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     USER_PRINCIPALS_ACL VARCHAR(120),
     ROLE_PRINCIPALS_ACL VARCHAR(120),
     GROUP_PRINCIPALS_ACL VARCHAR(120),
@@ -530,9 +535,9 @@
 
 CREATE TABLE FRAGMENT_CONSTRAINTS_REF
 (
-    CONSTRAINTS_REF_ID INT NOT NULL,
-    FRAGMENT_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINTS_REF_ID INTEGER NOT NULL,
+    FRAGMENT_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     PRIMARY KEY (CONSTRAINTS_REF_ID)
 );
@@ -547,8 +552,8 @@
 
 CREATE TABLE FRAGMENT_PREF
 (
-    PREF_ID INT NOT NULL,
-    FRAGMENT_ID INT NOT NULL,
+    PREF_ID INTEGER NOT NULL,
+    FRAGMENT_ID INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     IS_READ_ONLY SMALLINT NOT NULL,
     PRIMARY KEY (PREF_ID)
@@ -564,9 +569,9 @@
 
 CREATE TABLE FRAGMENT_PREF_VALUE
 (
-    PREF_VALUE_ID INT NOT NULL,
-    PREF_ID INT NOT NULL,
-    VALUE_ORDER INT NOT NULL,
+    PREF_VALUE_ID INTEGER NOT NULL,
+    PREF_ID INTEGER NOT NULL,
+    VALUE_ORDER INTEGER NOT NULL,
     VALUE VARCHAR(100) NOT NULL,
     PRIMARY KEY (PREF_VALUE_ID)
 );
@@ -574,13 +579,32 @@
 CREATE INDEX IX_FRAGMENT_PREF_VALUE_1 ON FRAGMENT_PREF_VALUE (PREF_ID);
 
 -- ----------------------------------------------------------------------- 
+-- FRAGMENT_PROP 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE FRAGMENT_PROP
+(
+    PROP_ID INTEGER NOT NULL,
+    FRAGMENT_ID INTEGER NOT NULL,
+    NAME VARCHAR(40) NOT NULL,
+    SCOPE VARCHAR(10),
+    SCOPE_VALUE VARCHAR(40),
+    VALUE VARCHAR(100) NOT NULL,        
+    PRIMARY KEY (PROP_ID)
+);
+
+CREATE INDEX IX_FRAGMENT_PROP_1 ON FRAGMENT_PROP (FRAGMENT_ID);
+
+CREATE UNIQUE INDEX UN_FRAGMENT_PROP ON FRAGMENT_PROP (FRAGMENT_ID, NAME,SCOPE,SCOPE_VALUE);
+
+-- ----------------------------------------------------------------------- 
 -- LINK 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE LINK
 (
-    LINK_ID INT NOT NULL,
-    PARENT_ID INT NOT NULL,
+    LINK_ID INTEGER NOT NULL,
+    PARENT_ID INTEGER NOT NULL,
     PATH VARCHAR(240) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     VERSION VARCHAR(40),
@@ -612,10 +636,10 @@
 
 CREATE TABLE LINK_METADATA
 (
-    METADATA_ID INT NOT NULL,
-    LINK_ID INT NOT NULL,
+    METADATA_ID INTEGER NOT NULL,
+    LINK_ID INTEGER NOT NULL,
     NAME VARCHAR(15) NOT NULL,
-    LOCALE VARCHAR(20) NOT NULL,
+    LOCALE VARCHAR(20),
     VALUE VARCHAR(100) NOT NULL,
     PRIMARY KEY (METADATA_ID)
 );
@@ -630,9 +654,9 @@
 
 CREATE TABLE LINK_CONSTRAINT
 (
-    CONSTRAINT_ID INT NOT NULL,
-    LINK_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINT_ID INTEGER NOT NULL,
+    LINK_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     USER_PRINCIPALS_ACL VARCHAR(120),
     ROLE_PRINCIPALS_ACL VARCHAR(120),
     GROUP_PRINCIPALS_ACL VARCHAR(120),
@@ -648,9 +672,9 @@
 
 CREATE TABLE LINK_CONSTRAINTS_REF
 (
-    CONSTRAINTS_REF_ID INT NOT NULL,
-    LINK_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINTS_REF_ID INTEGER NOT NULL,
+    LINK_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     PRIMARY KEY (CONSTRAINTS_REF_ID)
 );
@@ -665,8 +689,8 @@
 
 CREATE TABLE PAGE_SECURITY
 (
-    PAGE_SECURITY_ID INT NOT NULL,
-    PARENT_ID INT NOT NULL,
+    PAGE_SECURITY_ID INTEGER NOT NULL,
+    PARENT_ID INTEGER NOT NULL,
     PATH VARCHAR(240) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     VERSION VARCHAR(40),
@@ -691,8 +715,8 @@
 
 CREATE TABLE PAGE_SEC_CONSTRAINTS_DEF
 (
-    CONSTRAINTS_DEF_ID INT NOT NULL,
-    PAGE_SECURITY_ID INT NOT NULL,
+    CONSTRAINTS_DEF_ID INTEGER NOT NULL,
+    PAGE_SECURITY_ID INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     PRIMARY KEY (CONSTRAINTS_DEF_ID)
 );
@@ -707,9 +731,9 @@
 
 CREATE TABLE PAGE_SEC_CONSTRAINT_DEF
 (
-    CONSTRAINT_DEF_ID INT NOT NULL,
-    CONSTRAINTS_DEF_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINT_DEF_ID INTEGER NOT NULL,
+    CONSTRAINTS_DEF_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     USER_PRINCIPALS_ACL VARCHAR(120),
     ROLE_PRINCIPALS_ACL VARCHAR(120),
     GROUP_PRINCIPALS_ACL VARCHAR(120),
@@ -725,9 +749,9 @@
 
 CREATE TABLE PAGE_SEC_CONSTRAINTS_REF
 (
-    CONSTRAINTS_REF_ID INT NOT NULL,
-    PAGE_SECURITY_ID INT NOT NULL,
-    APPLY_ORDER INT NOT NULL,
+    CONSTRAINTS_REF_ID INTEGER NOT NULL,
+    PAGE_SECURITY_ID INTEGER NOT NULL,
+    APPLY_ORDER INTEGER NOT NULL,
     NAME VARCHAR(40) NOT NULL,
     PRIMARY KEY (CONSTRAINTS_REF_ID)
 );
@@ -756,11 +780,11 @@
 (
     CRITERION_ID VARCHAR(80) NOT NULL,
     RULE_ID VARCHAR(80) NOT NULL,
-    FALLBACK_ORDER INT NOT NULL,
+    FALLBACK_ORDER INTEGER NOT NULL,
     REQUEST_TYPE VARCHAR(40) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     COLUMN_VALUE VARCHAR(128),
-    FALLBACK_TYPE INT DEFAULT 1,
+    FALLBACK_TYPE INTEGER DEFAULT 1,
     PRIMARY KEY (CRITERION_ID)
 );
 
@@ -800,8 +824,8 @@
     COUNTRY VARCHAR(40) NOT NULL,
     CITY VARCHAR(40) NOT NULL,
     STADIUM VARCHAR(80) NOT NULL,
-    CAPACITY INT,
-    FOUNDED INT,
+    CAPACITY INTEGER,
+    FOUNDED INTEGER,
     PITCH VARCHAR(40),
     NICKNAME VARCHAR(40),
     PRIMARY KEY (NAME)
@@ -815,9 +839,9 @@
 (
     TABLENAME VARCHAR(175) NOT NULL,
     FIELDNAME VARCHAR(70) NOT NULL,
-    MAX_KEY INT,
-    GRAB_SIZE INT,
-    VERSION INT,
+    MAX_KEY INTEGER,
+    GRAB_SIZE INTEGER,
+    VERSION INTEGER,
     PRIMARY KEY (TABLENAME, FIELDNAME)
 );
 
@@ -830,8 +854,8 @@
     OID_ VARCHAR(250) NOT NULL,
     TX_ID VARCHAR(50) NOT NULL,
     TIMESTAMP_ DATETIME,
-    ISOLATIONLEVEL INT,
-    LOCKTYPE INT,
+    ISOLATIONLEVEL INTEGER,
+    LOCKTYPE INTEGER,
     PRIMARY KEY (OID_, TX_ID)
 );
 
@@ -852,8 +876,8 @@
 
 CREATE TABLE OJB_DLIST
 (
-    ID INT NOT NULL,
-    SIZE_ INT,
+    ID INTEGER NOT NULL,
+    SIZE_ INTEGER,
     PRIMARY KEY (ID)
 );
 
@@ -863,9 +887,9 @@
 
 CREATE TABLE OJB_DLIST_ENTRIES
 (
-    ID INT NOT NULL,
-    DLIST_ID INT,
-    POSITION_ INT,
+    ID INTEGER NOT NULL,
+    DLIST_ID INTEGER,
+    POSITION_ INTEGER,
     OID_ IMAGE,
     PRIMARY KEY (ID)
 );
@@ -876,8 +900,8 @@
 
 CREATE TABLE OJB_DSET
 (
-    ID INT NOT NULL,
-    SIZE_ INT,
+    ID INTEGER NOT NULL,
+    SIZE_ INTEGER,
     PRIMARY KEY (ID)
 );
 
@@ -887,9 +911,9 @@
 
 CREATE TABLE OJB_DSET_ENTRIES
 (
-    ID INT NOT NULL,
-    DLIST_ID INT,
-    POSITION_ INT,
+    ID INTEGER NOT NULL,
+    DLIST_ID INTEGER,
+    POSITION_ INTEGER,
     OID_ IMAGE,
     PRIMARY KEY (ID)
 );
@@ -900,8 +924,8 @@
 
 CREATE TABLE OJB_DMAP
 (
-    ID INT NOT NULL,
-    SIZE_ INT,
+    ID INTEGER NOT NULL,
+    SIZE_ INTEGER,
     PRIMARY KEY (ID)
 );
 
@@ -911,15 +935,15 @@
 
 CREATE TABLE PORTLET_DEFINITION
 (
-    ID INT NOT NULL,
+    ID INTEGER NOT NULL,
     NAME VARCHAR(80),
     CLASS_NAME VARCHAR(255),
-    APPLICATION_ID INT NOT NULL,
-    PORTLET_IDENTIFIER VARCHAR(80),
-    EXPIRATION_CACHE VARCHAR(30),
+    APPLICATION_ID INTEGER NOT NULL,
+    EXPIRATION_CACHE INTEGER,
     RESOURCE_BUNDLE VARCHAR(255),
     PREFERENCE_VALIDATOR VARCHAR(255),
     SECURITY_REF VARCHAR(40),
+    CACHE_SCOPE VARCHAR(30),
     PRIMARY KEY (ID)
 );
 
@@ -929,39 +953,29 @@
 
 CREATE TABLE PORTLET_APPLICATION
 (
-    APPLICATION_ID INT NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
     APP_NAME VARCHAR(80) NOT NULL,
-    APP_IDENTIFIER VARCHAR(80),
+    CONTEXT_PATH VARCHAR(255) NOT NULL,
+    REVISION INTEGER NOT NULL,
     VERSION VARCHAR(80),
-    APP_TYPE INT,
+    APP_TYPE INTEGER,
     CHECKSUM VARCHAR(80),
-    DESCRIPTION VARCHAR(80),
-    WEB_APP_ID INT NOT NULL,
     SECURITY_REF VARCHAR(40),
+    DEFAULT_NAMESPACE VARCHAR(120),
+    RESOURCE_BUNDLE VARCHAR(255),
     PRIMARY KEY (APPLICATION_ID)
 );
 
 CREATE UNIQUE INDEX UK_APPLICATION ON PORTLET_APPLICATION (APP_NAME);
 
 -- ----------------------------------------------------------------------- 
--- WEB_APPLICATION 
--- ----------------------------------------------------------------------- 
-
-CREATE TABLE WEB_APPLICATION
-(
-    ID INT NOT NULL,
-    CONTEXT_ROOT VARCHAR(255) NOT NULL,
-    PRIMARY KEY (ID)
-);
-
--- ----------------------------------------------------------------------- 
 -- PA_METADATA_FIELDS 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE PA_METADATA_FIELDS
 (
-    ID INT NOT NULL,
-    OBJECT_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    OBJECT_ID INTEGER NOT NULL,
     COLUMN_VALUE TEXT NOT NULL,
     NAME VARCHAR(100) NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
@@ -974,8 +988,8 @@
 
 CREATE TABLE PD_METADATA_FIELDS
 (
-    ID INT NOT NULL,
-    OBJECT_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    OBJECT_ID INTEGER NOT NULL,
     COLUMN_VALUE TEXT NOT NULL,
     NAME VARCHAR(100) NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
@@ -988,71 +1002,64 @@
 
 CREATE TABLE LANGUAGE
 (
-    ID INT NOT NULL,
-    PORTLET_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    PORTLET_ID INTEGER NOT NULL,
+    LOCALE_STRING VARCHAR(50) NOT NULL,
+    SUPPORTED_LOCALE SMALLINT NOT NULL,
     TITLE VARCHAR(100),
     SHORT_TITLE VARCHAR(100),
-    LOCALE_STRING VARCHAR(50) NOT NULL,
     KEYWORDS TEXT,
     PRIMARY KEY (ID)
 );
 
 -- ----------------------------------------------------------------------- 
--- PORTLET_CONTENT_TYPE 
+-- PORTLET_SUPPORTS 
 -- ----------------------------------------------------------------------- 
 
-CREATE TABLE PORTLET_CONTENT_TYPE
+CREATE TABLE PORTLET_SUPPORTS
 (
-    CONTENT_TYPE_ID INT NOT NULL,
-    PORTLET_ID INT NOT NULL,
-    CONTENT_TYPE VARCHAR(30) NOT NULL,
-    MODES TEXT,
-    PRIMARY KEY (CONTENT_TYPE_ID)
+    SUPPORTS_ID INTEGER NOT NULL,
+    PORTLET_ID INTEGER NOT NULL,
+    MIME_TYPE VARCHAR(30) NOT NULL,
+    MODES VARCHAR(255),
+    STATES VARCHAR(255),
+    PRIMARY KEY (SUPPORTS_ID)
 );
 
+CREATE UNIQUE INDEX UK_SUPPORTS ON PORTLET_SUPPORTS (PORTLET_ID, MIME_TYPE);
+
 -- ----------------------------------------------------------------------- 
 -- PARAMETER 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE PARAMETER
 (
-    PARAMETER_ID INT NOT NULL,
-    PARENT_ID INT NOT NULL,
-    CLASS_NAME VARCHAR(255) NOT NULL,
+    PARAMETER_ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    OWNER_CLASS_NAME VARCHAR(255) NOT NULL,
     NAME VARCHAR(80) NOT NULL,
     PARAMETER_VALUE TEXT,
     PRIMARY KEY (PARAMETER_ID)
 );
 
 -- ----------------------------------------------------------------------- 
--- PORTLET_ENTITY 
--- ----------------------------------------------------------------------- 
-
-CREATE TABLE PORTLET_ENTITY
-(
-    PEID INT NOT NULL,
-    ID VARCHAR(80) NOT NULL,
-    APP_NAME VARCHAR(80) NOT NULL,
-    PORTLET_NAME VARCHAR(80) NOT NULL,
-    PRIMARY KEY (PEID)
-);
-
-CREATE UNIQUE INDEX UK_ENTITY_ID ON PORTLET_ENTITY (ID);
-
--- ----------------------------------------------------------------------- 
 -- PORTLET_PREFERENCE 
 -- ----------------------------------------------------------------------- 
 
 CREATE TABLE PORTLET_PREFERENCE
 (
-    ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    DTYPE VARCHAR(10) NOT NULL,
     APPLICATION_NAME VARCHAR(80) NOT NULL,
     PORTLET_NAME VARCHAR(80) NOT NULL,
+    ENTITY_ID VARCHAR(80),
+    USER_NAME VARCHAR(80),
     NAME VARCHAR(254) NOT NULL,
+    READONLY SMALLINT NOT NULL,
     PRIMARY KEY (ID)
 );
 
-CREATE UNIQUE INDEX UIX_PORTLET_PREFERENCE ON PORTLET_PREFERENCE (APPLICATION_NAME, PORTLET_NAME,
NAME);
+CREATE UNIQUE INDEX UIX_PORTLET_PREFERENCE ON PORTLET_PREFERENCE (DTYPE, APPLICATION_NAME,
PORTLET_NAME, ENTITY_ID, USER_NAME, NAME);
 
 -- ----------------------------------------------------------------------- 
 -- PORTLET_PREFERENCE_VALUE 
@@ -1060,15 +1067,11 @@
 
 CREATE TABLE PORTLET_PREFERENCE_VALUE
 (
-    PREF_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    PREF_ID INTEGER NOT NULL,
     IDX SMALLINT NOT NULL,
-    ENTITY_OID INT NOT NULL,
-    USER_NAME VARCHAR(80) NOT NULL,
-    ENTITY_ID VARCHAR(80),
-    READONLY SMALLINT NOT NULL,
-    NULL_VALUE SMALLINT NOT NULL,
     PREF_VALUE VARCHAR(4000),
-    PRIMARY KEY (PREF_ID, IDX, ENTITY_OID, USER_NAME)
+    PRIMARY KEY (ID, PREF_ID, IDX)
 );
 
 CREATE INDEX IX_PREFS_PREF_ID ON PORTLET_PREFERENCE_VALUE (PREF_ID);
@@ -1079,8 +1082,8 @@
 
 CREATE TABLE SECURITY_ROLE_REFERENCE
 (
-    ID INT NOT NULL,
-    PORTLET_DEFINITION_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    PORTLET_DEFINITION_ID INTEGER NOT NULL,
     ROLE_NAME VARCHAR(150) NOT NULL,
     ROLE_LINK VARCHAR(150),
     PRIMARY KEY (ID)
@@ -1092,10 +1095,9 @@
 
 CREATE TABLE SECURITY_ROLE
 (
-    ID INT NOT NULL,
-    WEB_APPLICATION_ID INT NOT NULL,
-    ROLE_NAME VARCHAR(150) NOT NULL,
-    DESCRIPTION VARCHAR(150),
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    NAME VARCHAR(150) NOT NULL,
     PRIMARY KEY (ID)
 );
 
@@ -1105,8 +1107,8 @@
 
 CREATE TABLE USER_ATTRIBUTE_REF
 (
-    ID INT NOT NULL,
-    APPLICATION_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
     NAME VARCHAR(150),
     NAME_LINK VARCHAR(150),
     PRIMARY KEY (ID)
@@ -1118,10 +1120,9 @@
 
 CREATE TABLE USER_ATTRIBUTE
 (
-    ID INT NOT NULL,
-    APPLICATION_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
     NAME VARCHAR(150),
-    DESCRIPTION VARCHAR(150),
     PRIMARY KEY (ID)
 );
 
@@ -1131,8 +1132,8 @@
 
 CREATE TABLE JETSPEED_SERVICE
 (
-    ID INT NOT NULL,
-    APPLICATION_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
     NAME VARCHAR(150),
     PRIMARY KEY (ID)
 );
@@ -1143,9 +1144,9 @@
 
 CREATE TABLE LOCALIZED_DESCRIPTION
 (
-    ID INT NOT NULL,
-    OBJECT_ID INT NOT NULL,
-    CLASS_NAME VARCHAR(255) NOT NULL,
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    OWNER_CLASS_NAME VARCHAR(255) NOT NULL,
     DESCRIPTION TEXT NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
     PRIMARY KEY (ID)
@@ -1157,9 +1158,9 @@
 
 CREATE TABLE LOCALIZED_DISPLAY_NAME
 (
-    ID INT NOT NULL,
-    OBJECT_ID INT NOT NULL,
-    CLASS_NAME VARCHAR(255),
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    OWNER_CLASS_NAME VARCHAR(255),
     DISPLAY_NAME TEXT NOT NULL,
     LOCALE_STRING VARCHAR(50) NOT NULL,
     PRIMARY KEY (ID)
@@ -1171,11 +1172,11 @@
 
 CREATE TABLE CUSTOM_PORTLET_MODE
 (
-    ID INT NOT NULL,
-    APPLICATION_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
     CUSTOM_NAME VARCHAR(150) NOT NULL,
     MAPPED_NAME VARCHAR(150),
-    DESCRIPTION TEXT,
+    PORTAL_MANAGED SMALLINT NOT NULL,
     PRIMARY KEY (ID)
 );
 
@@ -1185,11 +1186,231 @@
 
 CREATE TABLE CUSTOM_WINDOW_STATE
 (
-    ID INT NOT NULL,
-    APPLICATION_ID INT NOT NULL,
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
     CUSTOM_NAME VARCHAR(150) NOT NULL,
     MAPPED_NAME VARCHAR(150),
-    DESCRIPTION TEXT,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- EVENT_DEFINITION 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE EVENT_DEFINITION
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    LOCAL_PART VARCHAR(80) NOT NULL,
+    NAMESPACE VARCHAR(80),
+    PREFIX VARCHAR(20),
+    VALUE_TYPE VARCHAR(255),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- EVENT_ALIAS 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE EVENT_ALIAS
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    LOCAL_PART VARCHAR(80) NOT NULL,
+    NAMESPACE VARCHAR(80),
+    PREFIX VARCHAR(20),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PARAMETER_ALIAS 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PARAMETER_ALIAS
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    LOCAL_PART VARCHAR(80) NOT NULL,
+    NAMESPACE VARCHAR(80),
+    PREFIX VARCHAR(20),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PUBLISHING_EVENT 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PUBLISHING_EVENT
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    LOCAL_PART VARCHAR(80) NOT NULL,
+    NAMESPACE VARCHAR(80),
+    PREFIX VARCHAR(20),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PROCESSING_EVENT 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PROCESSING_EVENT
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    LOCAL_PART VARCHAR(80) NOT NULL,
+    NAMESPACE VARCHAR(80),
+    PREFIX VARCHAR(20),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- NAMED_PARAMETER 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE NAMED_PARAMETER
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    NAME VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- RUNTIME_OPTION 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE RUNTIME_OPTION
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    OWNER_CLASS_NAME VARCHAR(255) NOT NULL,
+    NAME VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- RUNTIME_VALUE 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE RUNTIME_VALUE
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    RVALUE VARCHAR(200) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PUBLIC_PARAMETER 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PUBLIC_PARAMETER
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    LOCAL_PART VARCHAR(80) NOT NULL,
+    NAMESPACE VARCHAR(80),
+    PREFIX VARCHAR(20),
+    IDENTIFIER VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PORTLET_FILTER 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PORTLET_FILTER
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    FILTER_NAME VARCHAR(80) NOT NULL,
+    FILTER_CLASS VARCHAR(255),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- FILTER_LIFECYCLE 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE FILTER_LIFECYCLE
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    NAME VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- FILTER_MAPPING 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE FILTER_MAPPING
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    FILTER_NAME VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- FILTERED_PORTLET 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE FILTERED_PORTLET
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    NAME VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PORTLET_LISTENER 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PORTLET_LISTENER
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    LISTENER_CLASS VARCHAR(255),
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- PA_SECURITY_CONSTRAINT 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE PA_SECURITY_CONSTRAINT
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    TRANSPORT VARCHAR(40) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- SECURED_PORTLET 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE SECURED_PORTLET
+(
+    ID INTEGER NOT NULL,
+    OWNER_ID INTEGER NOT NULL,
+    NAME VARCHAR(150) NOT NULL,
+    PRIMARY KEY (ID)
+);
+
+-- ----------------------------------------------------------------------- 
+-- LOCALE_ENCODING_MAPPING 
+-- ----------------------------------------------------------------------- 
+
+CREATE TABLE LOCALE_ENCODING_MAPPING
+(
+    ID INTEGER NOT NULL,
+    APPLICATION_ID INTEGER NOT NULL,
+    LOCALE_STRING VARCHAR(50) NOT NULL,
+    ENCODING VARCHAR(50) NOT NULL,
     PRIMARY KEY (ID)
 );
 
@@ -1199,7 +1420,7 @@
 
 CREATE TABLE SECURITY_PRINCIPAL
 (
-    PRINCIPAL_ID INT NOT NULL,
+    PRINCIPAL_ID INTEGER NOT NULL,
     PRINCIPAL_TYPE VARCHAR(20) NOT NULL,
     PRINCIPAL_NAME VARCHAR(200) NOT NULL,
     IS_MAPPED SMALLINT NOT NULL,
@@ -1208,10 +1429,11 @@
     IS_REMOVABLE SMALLINT NOT NULL,
     CREATION_DATE DATETIME NOT NULL,
     MODIFIED_DATE DATETIME NOT NULL,
+    DOMAIN_ID INTEGER NOT NULL,
     PRIMARY KEY (PRINCIPAL_ID)
 );
 
-CREATE UNIQUE INDEX UIX_SECURITY_PRINCIPAL ON SECURITY_PRINCIPAL (PRINCIPAL_TYPE, PRINCIPAL_NAME);
+CREATE UNIQUE INDEX UIX_SECURITY_PRINCIPAL ON SECURITY_PRINCIPAL (PRINCIPAL_TYPE, PRINCIPAL_NAME,
DOMAIN_ID);
 
 -- ----------------------------------------------------------------------- 
 -- SECURITY_ATTRIBUTE 
@@ -1219,8 +1441,8 @@
 
 CREATE TABLE SECURITY_ATTRIBUTE
 (
-    ATTR_ID INT NOT NULL,
-    PRINCIPAL_ID INT NOT NULL,
+    ATTR_ID INTEGER NOT NULL,
+    PRINCIPAL_ID INTEGER NOT NULL,
     ATTR_NAME VARCHAR(200) NOT NULL,
     ATTR_VALUE VARCHAR(1000),
     PRIMARY KEY (ATTR_ID, PRINCIPAL_ID, ATTR_NAME)
@@ -1235,8 +1457,8 @@
 CREATE TABLE SECURITY_PRINCIPAL_ASSOC
 (
     ASSOC_NAME VARCHAR(30) NOT NULL,
-    FROM_PRINCIPAL_ID INT NOT NULL,
-    TO_PRINCIPAL_ID INT NOT NULL,
+    FROM_PRINCIPAL_ID INTEGER NOT NULL,
+    TO_PRINCIPAL_ID INTEGER NOT NULL,
     PRIMARY KEY (ASSOC_NAME, FROM_PRINCIPAL_ID, TO_PRINCIPAL_ID)
 );
 
@@ -1248,14 +1470,14 @@
 
 CREATE TABLE SECURITY_PERMISSION
 (
-    PERMISSION_ID INT NOT NULL,
+    PERMISSION_ID INTEGER NOT NULL,
     PERMISSION_TYPE VARCHAR(30) NOT NULL,
     NAME VARCHAR(254) NOT NULL,
     ACTIONS VARCHAR(254) NOT NULL,
     PRIMARY KEY (PERMISSION_ID)
 );
 
-CREATE UNIQUE INDEX UIX_SECURITY_PERMISSION ON SECURITY_PERMISSION (PERMISSION_TYPE, NAME);
+CREATE UNIQUE INDEX UIX_SECURITY_PERMISSION ON SECURITY_PERMISSION (PERMISSION_TYPE, NAME,ACTIONS);
 
 -- ----------------------------------------------------------------------- 
 -- PRINCIPAL_PERMISSION 
@@ -1263,8 +1485,8 @@
 
 CREATE TABLE PRINCIPAL_PERMISSION
 (
-    PRINCIPAL_ID INT NOT NULL,
-    PERMISSION_ID INT NOT NULL,
+    PRINCIPAL_ID INTEGER NOT NULL,
+    PERMISSION_ID INTEGER NOT NULL,
     PRIMARY KEY (PRINCIPAL_ID, PERMISSION_ID)
 );
 
@@ -1274,8 +1496,8 @@
 
 CREATE TABLE SECURITY_CREDENTIAL
 (
-    CREDENTIAL_ID INT NOT NULL,
-    PRINCIPAL_ID INT NOT NULL,
+    CREDENTIAL_ID INTEGER NOT NULL,
+    PRINCIPAL_ID INTEGER NOT NULL,
     CREDENTIAL_VALUE VARCHAR(254),
     TYPE SMALLINT NOT NULL,
     UPDATE_ALLOWED SMALLINT NOT NULL,
@@ -1299,7 +1521,7 @@
 
 CREATE TABLE SSO_SITE
 (
-    SITE_ID INT NOT NULL,
+    SITE_ID INTEGER NOT NULL,
     NAME VARCHAR(254) NOT NULL,
     URL VARCHAR(254) NOT NULL,
     ALLOW_USER_SET SMALLINT DEFAULT 0,
@@ -1309,66 +1531,29 @@
     FORM_USER_FIELD VARCHAR(128),
     FORM_PWD_FIELD VARCHAR(128),
     REALM VARCHAR(128),
+    DOMAIN_ID INTEGER NOT NULL,
     PRIMARY KEY (SITE_ID)
 );
 
-CREATE UNIQUE INDEX UIX_SITE_URL ON SSO_SITE (URL);
-
--- ----------------------------------------------------------------------- 
--- SSO_COOKIE 
--- ----------------------------------------------------------------------- 
-
-CREATE TABLE SSO_COOKIE
-(
-    COOKIE_ID INT NOT NULL,
-    COOKIE VARCHAR(1024) NOT NULL,
-    CREATE_DATE DATETIME NOT NULL,
-    PRIMARY KEY (COOKIE_ID)
-);
-
--- ----------------------------------------------------------------------- 
--- SSO_SITE_TO_PRINCIPALS 
--- ----------------------------------------------------------------------- 
-
-CREATE TABLE SSO_SITE_TO_PRINCIPALS
-(
-    SITE_ID INT NOT NULL,
-    PRINCIPAL_ID INT NOT NULL,
-    PRIMARY KEY (SITE_ID, PRINCIPAL_ID)
-);
-
--- ----------------------------------------------------------------------- 
--- SSO_PRINCIPAL_TO_REMOTE 
--- ----------------------------------------------------------------------- 
+CREATE UNIQUE INDEX UIX_SITE_NAME ON SSO_SITE (NAME);
 
-CREATE TABLE SSO_PRINCIPAL_TO_REMOTE
-(
-    PRINCIPAL_ID INT NOT NULL,
-    REMOTE_PRINCIPAL_ID INT NOT NULL,
-    PRIMARY KEY (PRINCIPAL_ID, REMOTE_PRINCIPAL_ID)
-);
+CREATE UNIQUE INDEX UIX_SITE_URL ON SSO_SITE (URL);
 
 -- ----------------------------------------------------------------------- 
--- SSO_SITE_TO_REMOTE 
+-- SECURITY_DOMAIN 
 -- ----------------------------------------------------------------------- 
 
-CREATE TABLE SSO_SITE_TO_REMOTE
+CREATE TABLE SECURITY_DOMAIN
 (
-    SITE_ID INT NOT NULL,
-    PRINCIPAL_ID INT NOT NULL,
-    PRIMARY KEY (SITE_ID, PRINCIPAL_ID)
+    DOMAIN_ID INTEGER NOT NULL,
+    DOMAIN_NAME VARCHAR(30),
+    REMOTE SMALLINT DEFAULT 0,
+    ENABLED SMALLINT DEFAULT 1,
+    OWNER_DOMAIN_ID INTEGER,
+    PRIMARY KEY (DOMAIN_ID)
 );
 
--- ----------------------------------------------------------------------- 
--- SSO_COOKIE_TO_REMOTE 
--- ----------------------------------------------------------------------- 
-
-CREATE TABLE SSO_COOKIE_TO_REMOTE
-(
-    COOKIE_ID INT NOT NULL,
-    REMOTE_PRINCIPAL_ID INT NOT NULL,
-    PRIMARY KEY (COOKIE_ID, REMOTE_PRINCIPAL_ID)
-);
+CREATE UNIQUE INDEX UIX_DOMAIN_NAME ON SECURITY_DOMAIN (DOMAIN_NAME);
 
 
 CREATE TRIGGER trig_folder ON FOLDER FOR DELETE AS DECLARE @FolderID INT SELECT @FolderID
= (SELECT FOLDER_ID FROM Deleted) DELETE FROM FOLDER WHERE PARENT_ID = @FolderID; 
@@ -1379,6 +1564,7 @@
 
 CREATE TRIGGER trig_page_menu ON PAGE_MENU FOR DELETE AS DECLARE @PageMenuID INT SELECT @PageMenuID
= (SELECT MENU_ID FROM Deleted) DELETE FROM PAGE_MENU WHERE PARENT_ID = @PageMenuID; 
 
+
 ALTER TABLE FOLDER
     ADD CONSTRAINT FK_FOLDER_1 FOREIGN KEY (PARENT_ID) REFERENCES FOLDER (FOLDER_ID) ON DELETE
NO ACTION;
 
@@ -1416,7 +1602,7 @@
     ADD CONSTRAINT FK_PAGE_CONSTRAINTS_REF_1 FOREIGN KEY (PAGE_ID) REFERENCES PAGE (PAGE_ID)
ON DELETE CASCADE;
 
 ALTER TABLE PAGE_MENU
-    ADD CONSTRAINT FK_PAGE_MENU_1 FOREIGN KEY (PARENT_ID) REFERENCES PAGE_MENU (MENU_ID)
ON DELETE NO ACTION;;
+    ADD CONSTRAINT FK_PAGE_MENU_1 FOREIGN KEY (PARENT_ID) REFERENCES PAGE_MENU (MENU_ID)
ON DELETE NO ACTION;
 
 ALTER TABLE PAGE_MENU
     ADD CONSTRAINT PM_M_FK_PAGE_ID_PAGE FOREIGN KEY (PAGE_ID) REFERENCES PAGE (PAGE_ID) ON
DELETE CASCADE;
@@ -1442,6 +1628,9 @@
 ALTER TABLE FRAGMENT_PREF_VALUE
     ADD CONSTRAINT FK_FRAGMENT_PREF_VALUE_1 FOREIGN KEY (PREF_ID) REFERENCES FRAGMENT_PREF
(PREF_ID) ON DELETE CASCADE;
 
+ALTER TABLE FRAGMENT_PROP
+    ADD CONSTRAINT FK_FRAGMENT_PROP_1 FOREIGN KEY (FRAGMENT_ID) REFERENCES FRAGMENT (FRAGMENT_ID)
ON DELETE CASCADE;
+
 ALTER TABLE LINK
     ADD CONSTRAINT FK_LINK_1 FOREIGN KEY (PARENT_ID) REFERENCES FOLDER (FOLDER_ID) ON DELETE
CASCADE;
 
@@ -1478,6 +1667,9 @@
 ALTER TABLE PORTLET_PREFERENCE_VALUE
     ADD CONSTRAINT FK_PORTLET_PREFERENCE FOREIGN KEY (PREF_ID) REFERENCES PORTLET_PREFERENCE
(ID) ON DELETE CASCADE;
 
+ALTER TABLE SECURITY_ROLE
+    ADD CONSTRAINT FK_SECURITY_ROLE_REF_1 FOREIGN KEY (APPLICATION_ID) REFERENCES PORTLET_APPLICATION
(APPLICATION_ID) ON DELETE CASCADE;
+
 ALTER TABLE USER_ATTRIBUTE_REF
     ADD CONSTRAINT FK_USER_ATTRIBUTE_REF_1 FOREIGN KEY (APPLICATION_ID) REFERENCES PORTLET_APPLICATION
(APPLICATION_ID) ON DELETE CASCADE;
 
@@ -1490,6 +1682,12 @@
 ALTER TABLE CUSTOM_WINDOW_STATE
     ADD CONSTRAINT FK_CUSTOM_WINDOW_STATE_1 FOREIGN KEY (APPLICATION_ID) REFERENCES PORTLET_APPLICATION
(APPLICATION_ID) ON DELETE CASCADE;
 
+ALTER TABLE EVENT_DEFINITION
+    ADD CONSTRAINT FK_EVENT_DEFINITION_1 FOREIGN KEY (APPLICATION_ID) REFERENCES PORTLET_APPLICATION
(APPLICATION_ID) ON DELETE CASCADE;
+
+ALTER TABLE SECURITY_PRINCIPAL
+    ADD CONSTRAINT FK_SECURITY_DOMAIN_1 FOREIGN KEY (DOMAIN_ID) REFERENCES SECURITY_DOMAIN
(DOMAIN_ID) ON DELETE CASCADE;
+
 ALTER TABLE SECURITY_ATTRIBUTE
     ADD CONSTRAINT FK_PRINCIPAL_ATTR FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL
(PRINCIPAL_ID) ON DELETE CASCADE;
 
@@ -1508,27 +1706,6 @@
 ALTER TABLE SECURITY_CREDENTIAL
     ADD CONSTRAINT FK_SECURITY_CREDENTIAL_1 FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL
(PRINCIPAL_ID) ON DELETE CASCADE;
 
-ALTER TABLE SSO_SITE_TO_PRINCIPALS
-    ADD CONSTRAINT SSO_SITE_TO_PRINC_FK1 FOREIGN KEY (SITE_ID) REFERENCES SSO_SITE (SITE_ID)
ON DELETE CASCADE;
-
-ALTER TABLE SSO_SITE_TO_PRINCIPALS
-    ADD CONSTRAINT SSO_SITE_TO_PRINC_FK2 FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL
(PRINCIPAL_ID) ON DELETE CASCADE;
-
-ALTER TABLE SSO_PRINCIPAL_TO_REMOTE
-    ADD CONSTRAINT FK_SSO_PRINCIPAL_TO_REMOTE_1 FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL
(PRINCIPAL_ID) ON DELETE CASCADE;
-
-ALTER TABLE SSO_PRINCIPAL_TO_REMOTE
-    ADD CONSTRAINT FK_SSO_PRINCIPAL_TO_REMOTE_2 FOREIGN KEY (REMOTE_PRINCIPAL_ID) REFERENCES
SECURITY_PRINCIPAL (PRINCIPAL_ID) ON DELETE NO ACTION;
-
-ALTER TABLE SSO_SITE_TO_REMOTE
-    ADD CONSTRAINT FK_SSO_SITE_TO_REMOTE_1 FOREIGN KEY (SITE_ID) REFERENCES SSO_SITE (SITE_ID)
ON DELETE CASCADE;
-
-ALTER TABLE SSO_SITE_TO_REMOTE
-    ADD CONSTRAINT FK_SSO_SITE_TO_REMOTE_2 FOREIGN KEY (PRINCIPAL_ID) REFERENCES SECURITY_PRINCIPAL
(PRINCIPAL_ID) ON DELETE CASCADE;
-
-ALTER TABLE SSO_COOKIE_TO_REMOTE
-    ADD CONSTRAINT FK_SSO_COOKIE_TO_REMOTE_1 FOREIGN KEY (COOKIE_ID) REFERENCES SSO_COOKIE
(COOKIE_ID) ON DELETE CASCADE;
-
-ALTER TABLE SSO_COOKIE_TO_REMOTE
-    ADD CONSTRAINT FK_SSO_COOKIE_TO_REMOTE_2 FOREIGN KEY (REMOTE_PRINCIPAL_ID) REFERENCES
SECURITY_PRINCIPAL (PRINCIPAL_ID) ON DELETE CASCADE;
+ALTER TABLE SSO_SITE
+    ADD CONSTRAINT FK_SECURITY_DOMAIN_2 FOREIGN KEY (DOMAIN_ID) REFERENCES SECURITY_DOMAIN
(DOMAIN_ID) ON DELETE CASCADE;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message