[pal-cvs 2777] [524] added fk for whos_online.

svnno****@sourc***** svnno****@sourc*****
2007年 9月 3日 (月) 15:36:05 JST


Revision: 524
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=524
Author:   shinsuke
Date:     2007-09-03 15:36:05 +0900 (Mon, 03 Sep 2007)

Log Message:
-----------
added fk for whos_online.

Modified Paths:
--------------
    pompei/portlets/pompei-core/trunk/src/main/webapp/WEB-INF/db/create_table.sql


-------------- next part --------------
Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/WEB-INF/db/create_table.sql
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/WEB-INF/db/create_table.sql	2007-09-03 06:35:02 UTC (rev 523)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/WEB-INF/db/create_table.sql	2007-09-03 06:36:05 UTC (rev 524)
@@ -82,16 +82,6 @@
      , PRIMARY KEY (CUSTOMERS_ID)
 );
 
-CREATE TABLE CUSTOMERS_INFO (
-       CUSTOMERS_INFO_ID INTEGER NOT NULL
-     , CUSTOMERS_INFO_DATE_OF_LAST_LOGON TIMESTAMP
-     , CUSTOMERS_INFO_NUMBER_OF_LOGONS INTEGER
-     , CUSTOMERS_INFO_DATE_ACCOUNT_CREATED TIMESTAMP
-     , CUSTOMERS_INFO_DATE_ACCOUNT_LAST_MODIFIED TIMESTAMP
-     , GLOBAL_PRODUCT_NOTIFICATIONS INTEGER DEFAULT 0
-     , PRIMARY KEY (CUSTOMERS_INFO_ID)
-);
-
 CREATE TABLE DELIVERY_METHOD (
        DELIVERY_METHOD_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)
      , DELIVERY_CLASS VARCHAR(128) NOT NULL
@@ -267,16 +257,6 @@
      , PRIMARY KEY (REVIEWS_ID)
 );
 
-CREATE TABLE WHOS_ONLINE (
-       CUSTOMER_ID INTEGER
-     , FULL_NAME VARCHAR(64) NOT NULL
-     , SESSION_ID VARCHAR(128) NOT NULL
-     , IP_ADDRESS VARCHAR(15) NOT NULL
-     , TIME_ENTRY VARCHAR(14) NOT NULL
-     , TIME_LAST_CLICK VARCHAR(14) NOT NULL
-     , LAST_PAGE_URL VARCHAR(255) NOT NULL
-);
-
 CREATE TABLE ZONES (
        ZONE_ID INTEGER NOT NULL
      , ZONE_COUNTRY_ID INTEGER NOT NULL
@@ -345,6 +325,16 @@
      , PRIMARY KEY (CUSTOMERS_BASKET_ATTRIBUTES_ID)
 );
 
+CREATE TABLE CUSTOMERS_INFO (
+       CUSTOMERS_INFO_ID INTEGER NOT NULL
+     , CUSTOMERS_INFO_DATE_OF_LAST_LOGON TIMESTAMP
+     , CUSTOMERS_INFO_NUMBER_OF_LOGONS INTEGER
+     , CUSTOMERS_INFO_DATE_ACCOUNT_CREATED TIMESTAMP
+     , CUSTOMERS_INFO_DATE_ACCOUNT_LAST_MODIFIED TIMESTAMP
+     , GLOBAL_PRODUCT_NOTIFICATIONS INTEGER DEFAULT 0
+     , PRIMARY KEY (CUSTOMERS_INFO_ID)
+);
+
 CREATE TABLE DELIVERY_METHOD_DESCRIPTION (
        DELIVERY_METHOD_ID INTEGER DEFAULT 0 NOT NULL
      , LANGUAGE_ID INTEGER DEFAULT 1 NOT NULL
@@ -489,6 +479,16 @@
      , PRIMARY KEY (TAX_RATES_ID)
 );
 
+CREATE TABLE WHOS_ONLINE (
+       CUSTOMER_ID INTEGER
+     , FULL_NAME VARCHAR(64) NOT NULL
+     , SESSION_ID VARCHAR(128) NOT NULL
+     , IP_ADDRESS VARCHAR(15) NOT NULL
+     , TIME_ENTRY VARCHAR(14) NOT NULL
+     , TIME_LAST_CLICK VARCHAR(14) NOT NULL
+     , LAST_PAGE_URL VARCHAR(255) NOT NULL
+);
+
 CREATE TABLE ZONES_TO_GEO_ZONES (
        ASSOCIATION_ID INTEGER NOT NULL
      , ZONE_COUNTRY_ID INTEGER NOT NULL
@@ -581,11 +581,6 @@
       FOREIGN KEY (PRODUCTS_ID)
       REFERENCES PRODUCTS (PRODUCTS_ID);
 
-ALTER TABLE WHOS_ONLINE
-  ADD CONSTRAINT FK_WHOS_ONLINE_1
-      FOREIGN KEY (CUSTOMER_ID)
-      REFERENCES CUSTOMERS (CUSTOMERS_ID);
-
 ALTER TABLE ZONES
   ADD CONSTRAINT FK_ZONES_1
       FOREIGN KEY (ZONE_COUNTRY_ID)
@@ -650,6 +645,11 @@
       FOREIGN KEY (PRODUCTS_OPTIONS_ID)
       REFERENCES PRODUCTS_OPTIONS (PRODUCTS_OPTIONS_ID);
 
+ALTER TABLE CUSTOMERS_INFO
+  ADD CONSTRAINT FK_CUSTOMERS_INFO_1
+      FOREIGN KEY (CUSTOMERS_INFO_ID)
+      REFERENCES CUSTOMERS (CUSTOMERS_ID);
+
 ALTER TABLE DELIVERY_METHOD_DESCRIPTION
   ADD CONSTRAINT SQL070831021756940
       FOREIGN KEY (DELIVERY_METHOD_ID)
@@ -794,6 +794,11 @@
       FOREIGN KEY (TAX_ZONE_ID)
       REFERENCES ZONES (ZONE_ID);
 
+ALTER TABLE WHOS_ONLINE
+  ADD CONSTRAINT FK_WHOS_ONLINE_1
+      FOREIGN KEY (CUSTOMER_ID)
+      REFERENCES CUSTOMERS (CUSTOMERS_ID);
+
 ALTER TABLE ZONES_TO_GEO_ZONES
   ADD CONSTRAINT FK_ZONES_TO_GEO_ZONES_1
       FOREIGN KEY (ZONE_ID)


pal-cvs メーリングリストの案内