]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4963 Building up test cases with lifesci tenant. Also split up the create_db...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Mon, 2 Apr 2012 23:08:50 +0000 (16:08 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Mon, 2 Apr 2012 23:08:50 +0000 (16:08 -0700)
19 files changed:
build.xml
installer/build.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/lifesci_extended_co.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/lifesci_extended_injectedco.xml [new file with mode: 0644]
services/account/build.xml
services/account/pstore/build.xml
services/authentication/build.xml
services/authentication/pstore/build.xml
services/authorization-mgt/build.xml
services/authorization/build.xml
services/authorization/pstore/build.xml
services/build.xml
services/collectionobject/3rdparty/nuxeo-platform-collectionobject-lifesci/src/main/resources/schemas/collectionobjects_naturalhistory.xsd
services/id/build.xml
services/id/service/build.xml
src/main/resources/db/mysql/init_cspace_db.sql [new file with mode: 0644]
src/main/resources/db/mysql/init_nuxeo_db.sql [moved from src/main/resources/db/mysql/init_db.sql with 57% similarity]
src/main/resources/db/postgresql/init_cspace_db.sql [new file with mode: 0644]
src/main/resources/db/postgresql/init_nuxeo_db.sql [moved from src/main/resources/db/postgresql/init_db.sql with 69% similarity]

index 5c854c1562d58819ead34b97ccbc28903dee2fba..7d47c8650521b90f6822350417c9f45839375298 100644 (file)
--- a/build.xml
+++ b/build.xml
                <ant antfile="services/build.xml" target="gen_ddl" inheritAll="false"/>\r
        </target>\r
 \r
-       <target name="create_db" depends="create_base_db"\r
+       <target name="create_db" \r
             description="create database(s), invoke subtasks for indexes, etc.">\r
-               <ant antfile="services/build.xml" target="create_db" inheritAll="false"/>\r
+               <antcall target="create_nuxeo_db"/>\r
+               <antcall target="create_cspace_db"/>\r
        </target>\r
 \r
-       <target name="create_base_db" \r
-            description="create database(s), grant privileges to test users">\r
+       <target name="create_nuxeo_db" \r
+            description="create nuxeo database">\r
                <sql driver="${db.jdbc.driver.class}"\r
              url="${db.jdbc.baseurl}"\r
              userid="${db.user}"\r
              password="${db.user.password}"\r
                                                 autocommit="true"\r
-             src="${db.script.dir}/init_db.sql"\r
+             src="${db.script.dir}/init_nuxeo_db.sql"\r
              >\r
                        <classpath>\r
                                <pathelement path="${db.driver.jar}"/>\r
                        </classpath>\r
                </sql>\r
+               <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
+       </target>\r
+\r
+       <target name="create_cspace_db" \r
+               description="create cspace database">\r
+               <sql driver="${db.jdbc.driver.class}"\r
+             url="${db.jdbc.baseurl}"\r
+             userid="${db.user}"\r
+             password="${db.user.password}"\r
+                                                autocommit="true"\r
+             src="${db.script.dir}/init_cspace_db.sql"\r
+             >\r
+                       <classpath>\r
+                               <pathelement path="${db.driver.jar}"/>\r
+                       </classpath>\r
+               </sql>\r
+               <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false"/>\r
        </target>\r
 \r
        <target name="import"\r
index 066cf84d3ead0ea973b0196fd34ed8a12ab437ab..b04c1c49d14c421c60b1c94c50bd33a84cf8de40 100644 (file)
                                <ant antfile="services/build.xml" target="config" inheritAll="false"/>        \r
     </target>    \r
     \r
-    <target name="predeploy" depends="config">\r
-        <exec executable="echo">\r
-                       <arg value="Installer: Creating necessary databases and associated users and privileges." />\r
-                               </exec>\r
-        <sql driver="${db.jdbc.driver.class}"\r
-        url="${db.jdbc.baseurl}"\r
-        userid="${db.user}"\r
-        password="${db.user.password}"\r
-        src="${db.script.dir}/init_db.sql">\r
-            <classpath>\r
-                <pathelement path="${db.driver.jar}"/>\r
-            </classpath>\r
-        </sql>\r
-                               \r
+    <target name="predeploy" depends="config, create_cspace_db, create_nuxeo_db">\r
                                <!-- Now, invoke the "predeploy" target on each of the services' install directories -->\r
         <ant antfile="services/build.xml" target="predeploy" inheritAll="false"/>              \r
     </target>\r
+\r
+               <target name="create_nuxeo_db" \r
+                                                       description="create nuxeo database">\r
+                       <sql driver="${db.jdbc.driver.class}"\r
+                                                        url="${db.jdbc.baseurl}"\r
+                                                        userid="${db.user}"\r
+                                                        password="${db.user.password}"\r
+                                                        autocommit="true"\r
+                                                        src="${db.script.dir}/init_nuxeo_db.sql"\r
+                                                        >\r
+                               <classpath>\r
+                                       <pathelement path="${db.driver.jar}"/>\r
+                               </classpath>\r
+                       </sql>\r
+               <ant antfile="services/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
+               </target>\r
+\r
+               <target name="create_cspace_db" \r
+                       description="create cspace database">\r
+                       <sql driver="${db.jdbc.driver.class}"\r
+                                                        url="${db.jdbc.baseurl}"\r
+                                                        userid="${db.user}"\r
+                                                        password="${db.user.password}"\r
+                                                        autocommit="true"\r
+                                                        src="${db.script.dir}/init_cspace_db.sql"\r
+                                                        >\r
+                               <classpath>\r
+                                       <pathelement path="${db.driver.jar}"/>\r
+                               </classpath>\r
+                       </sql>\r
+               <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+               </target>\r
+\r
+\r
     \r
     <target name="deploy" description="">\r
                                <!-- Now, invoke the "deploy" target on each of the services' install directories -->\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/lifesci_extended_co.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/lifesci_extended_co.xml
new file mode 100644 (file)
index 0000000..0a244c2
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="collectionobjects">
+  <ns2:collectionobjects_naturalhistory
+    xmlns:ns2="http://collectionspace.org/services/collectionobject/domain/naturalhistory"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <taxonomicIdentGroupList>
+      <taxonomicIdentGroup>
+        <qualifier>questionable</qualifier>
+        <notes/>
+        <taxon>urn:cspace:lifesci.collectionspace.org:taxonomyauthority:name(taxon):item:name(AcerJaponicus1332900279183)'Acer
+          Japonicus'</taxon>
+        <reference/>
+        <identBy>urn:cspace:lifesci.collectionspace.org:personauthorities:name(person):item:name(PatrickSchmitz1332900293194)'Patrick
+          Schmitz'</identBy>
+        <institution/>
+      </taxonomicIdentGroup>
+    </taxonomicIdentGroupList>
+  </ns2:collectionobjects_naturalhistory>
+  <ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+               <objectNumber>2012.1.3</objectNumber>
+    <titleGroupList>
+      <titleGroup>
+        <title>This is a nice Object</title>
+        <titleType>generic</titleType>
+        <titleTranslationSubGroupList>
+          <titleTranslationSubGroup>
+            <titleTranslationLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(deu)'German'</titleTranslationLanguage>
+            <titleTranslation>Das ist ein nettes Object</titleTranslation>
+          </titleTranslationSubGroup>
+        </titleTranslationSubGroupList>
+        <titleLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(eng)'English'</titleLanguage>
+      </titleGroup>
+    </titleGroupList>
+    <responsibleDepartments>
+      <responsibleDepartment>antiquities</responsibleDepartment>
+    </responsibleDepartments>
+    <otherNumberList>
+      <otherNumber>
+        <numberValue>Obj123</numberValue>
+        <numberType>serial</numberType>
+      </otherNumber>
+    </otherNumberList>
+  </ns2:collectionobjects_common>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/lifesci_extended_injectedco.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/lifesci_extended_injectedco.xml
new file mode 100644 (file)
index 0000000..4e45d2b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="collectionobjects">
+  <ns2:collectionobjects_naturalhistory
+    xmlns:ns2="http://collectionspace.org/services/collectionobject/domain/naturalhistory"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <taxonomicIdentGroupList>
+      <taxonomicIdentGroup>
+        <qualifier>questionable</qualifier>
+        <notes/>
+        <taxon>urn:cspace:lifesci.collectionspace.org:taxonomyauthority:name(taxon):item:name(AcerJaponicus1332900279183)'Acer
+          Japonicus'</taxon>
+        <reference/>
+        <identBy>urn:cspace:lifesci.collectionspace.org:personauthorities:name(person):item:name(PatrickSchmitz1332900293194)'Patrick
+          Schmitz'</identBy>
+        <institution/>
+      </taxonomicIdentGroup>
+    </taxonomicIdentGroupList>
+    <nh_titleGroupList>
+                       <nh_titleGroup>
+                               <titleNote>This is an experiment</titleNote>
+                       </nh_titleGroup>
+               </nh_titleGroupList>
+  </ns2:collectionobjects_naturalhistory>
+  <ns2:collectionobjects_common xmlns:ns2="http://collectionspace.org/services/collectionobject"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+               <objectNumber>2012.1.4</objectNumber>
+    <titleGroupList>
+      <titleGroup>
+        <title>This is a nice Object</title>
+        <titleType>generic</titleType>
+        <titleTranslationSubGroupList>
+          <titleTranslationSubGroup>
+            <titleTranslationLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(deu)'German'</titleTranslationLanguage>
+            <titleTranslation>Das ist ein nettes Object</titleTranslation>
+          </titleTranslationSubGroup>
+        </titleTranslationSubGroupList>
+        <titleLanguage>urn:cspace:lifesci.collectionspace.org:vocabularies:name(languages):item:name(eng)'English'</titleLanguage>
+      </titleGroup>
+    </titleGroupList>
+    <responsibleDepartments>
+      <responsibleDepartment>antiquities</responsibleDepartment>
+    </responsibleDepartments>
+    <otherNumberList>
+      <otherNumber>
+        <numberValue>Obj123</numberValue>
+        <numberType>serial</numberType>
+      </otherNumber>
+    </otherNumberList>
+  </ns2:collectionobjects_common>
+</document>
index 35f631b27387befb05d9cb11f061b628f70e05b8..58b72f1923684ee305b818a2bc5464f97ea415cf 100644 (file)
         <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
     </target>\r
     \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for account service">\r
-        <ant antfile="pstore/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
     </target>\r
 \r
     <target name="deploy" depends="install"\r
index d2faa9b659c29190dba36310c74c841d895f88db..2aa7e2ace66fce15c48bec5b85a81ea048f739c6 100644 (file)
         </exec>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for account service">\r
                                <sql driver="${db.jdbc.driver.class}"\r
              url="${db.jdbc.cspace.url}"\r
index 03f666293e15e73ef7e4d1b16ccc1ebc5c530d20..2c16a79b688fe87c6e8420ef8821a8bc2fcd9fd7 100644 (file)
         <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for authentication service">\r
-        <ant antfile="pstore/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
     </target>\r
 \r
     <target name="deploy" depends="install"\r
index 6d532cc3eb54a2637d2e8c454ccb5d99c0d5b335..7599514c6aa25a2dba717db09e7133ec9bf60875 100644 (file)
         </exec>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for authentication service">\r
                                <sql driver="${db.jdbc.driver.class}"\r
              url="${db.jdbc.cspace.url}"\r
index d3d59c4b53b6030961ca193ff2891a6988877c1f..b8fcde446960d8f15fa49abd1266b3f24c20f302 100644 (file)
             description="generate service-specific tables(s), indices, etc.">\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for authorization service">\r
     </target>\r
 \r
index add2af1df8951e2a96a41b92b99d33475e1d5059..6642711d7d9ee003a63c8d9c9dba7da33c2282a4 100644 (file)
         <ant antfile="pstore/build.xml" target="gen_ddl" inheritAll="false"/>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for authorization service">\r
-        <ant antfile="pstore/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="pstore/build.xml" target="create_cspace_db" inheritAll="false"/>\r
     </target>\r
 \r
     <target name="deploy" depends="install"\r
index 9200c4b6d048d88782664e2597c68796afef6c6a..6e9a94820a01d747172505dff765d5ac4597220f 100644 (file)
         </exec>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create tables(s), indices for authorization service">\r
                                <sql driver="${db.jdbc.driver.class}"\r
              url="${db.jdbc.cspace.url}"\r
index 0abb9c54cc6e606c51f230fb2dcba0090fe91e4e..c08c244f45ef5fde2c603501fb76d483f678e680 100644 (file)
         <ant antfile="account/build.xml" target="gen_ddl" inheritAll="false"/>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_cspace_db"\r
             description="create service-specific tables(s), indices, etc.">\r
-        <ant antfile="authentication/build.xml" target="create_db" inheritAll="false"/>\r
-        <ant antfile="authorization/build.xml" target="create_db" inheritAll="false"/>\r
-        <ant antfile="account/build.xml" target="create_db" inheritAll="false"/>\r
-        <ant antfile="id/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="authentication/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+        <ant antfile="authorization/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+        <ant antfile="account/build.xml" target="create_cspace_db" inheritAll="false"/>\r
+    </target>\r
+\r
+    <target name="create_nuxeo_db"\r
+            description="create service-specific tables(s), indices, etc.">\r
+        <ant antfile="id/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
     </target>\r
 \r
     <target name="import"\r
index 895a69a7d415a60987f0cc35185ee8776f333c59..736a43853acae83d3c01edba0551b694ddf14177 100644 (file)
   targetNamespace="http://collectionspace.org/services/collectionobject/domain/naturalhistory"\r
   version="0.1">\r
 \r
-  <!-- used for testing\r
-  <xs:element name="nh-string" type="xs:string" />\r
-  <xs:element name="nh-int" type="xs:int"/>\r
-  <xs:element name="nh-long" type="xs:long"/>\r
-  <xs:element name="nh-date" type="xs:dateTime"/>\r
-  <xs:element name="nh-note" type="xs:string"/>\r
-  -->\r
-\r
   <!--  These items are being moved to common\r
   <xs:element name="fieldCollector" type="xs:string"/>\r
   <xs:element name="fieldCollectionDate" type="xs:string"/>\r
     <xs:element name="fieldLocLongDecimal" type="xs:string"/>\r
     <xs:element name="fieldLocElevation" type="xs:string"/>\r
 \r
+\r
+               <!-- Add in an extension field for the common title group -->\r
+               <xs:element name="nh_titleGroupList">\r
+                       <xs:complexType>\r
+                               <xs:sequence>\r
+                                       <xs:element name="nh_titleGroup">\r
+                                               <xs:complexType>\r
+                                                       <xs:sequence>\r
+                                                               <xs:element name="titleNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+                                                       </xs:sequence>\r
+                                               </xs:complexType>\r
+                                       </xs:element>\r
+                               </xs:sequence>\r
+                       </xs:complexType>\r
+    </xs:element>\r
+\r
+\r
   <!-- These will become contolled lists -->\r
     <xs:element name="fieldLocGeodeticDatum" type="xs:string"/>\r
     <xs:element name="fieldLocCoordinateSystem" type="xs:string"/>\r
index cef43930fdc02f54772d72ed71acc755dc2a9481..ee3dac387911cc98472c98f1c43922c254f1b0a9 100644 (file)
         </exec>\r
     </target>\r
 \r
-    <target name="create_db"\r
+    <target name="create_nuxeo_db"\r
     description="create tables(s), indices for id service">\r
-        <ant antfile="service/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="service/build.xml" target="create_nuxeo_db" inheritAll="false"/>\r
     </target>\r
 \r
     <target name="deploy" depends="install"\r
index 5e069ac74b6c44c6535e881ff72f452cbe1d487e..496d60bf887144447920ce297f3f8da806b806c1 100644 (file)
         </exec>
     </target>
 
-    <target name="create_db"
+    <target name="create_nuxeo_db"
     description="create tables(s), indices for id service">
                                <sql driver="${db.jdbc.driver.class}"
             url="${db.jdbc.nuxeo.url}"
diff --git a/src/main/resources/db/mysql/init_cspace_db.sql b/src/main/resources/db/mysql/init_cspace_db.sql
new file mode 100644 (file)
index 0000000..7d4cb29
--- /dev/null
@@ -0,0 +1,24 @@
+--
+-- delete all users
+--
+-- DELETE FROM mysql.user WHERE NOT (host="localhost" and user="root");
+-- FLUSH PRIVILEGES;
+
+--
+-- delete anonymous access
+--
+DELETE FROM mysql.user WHERE User = '';
+FLUSH PRIVILEGES;
+
+--
+-- recreate cspace database
+--
+DROP database IF EXISTS cspace;
+CREATE database cspace DEFAULT CHARACTER SET utf8;
+
+--
+-- grant privileges to users on cspace database
+--
+GRANT ALL PRIVILEGES ON cspace.* TO '@DB_CSPACE_USER@'@'localhost' IDENTIFIED BY '@DB_CSPACE_PASSWORD@' WITH GRANT OPTION;
+FLUSH PRIVILEGES;
+
similarity index 57%
rename from src/main/resources/db/mysql/init_db.sql
rename to src/main/resources/db/mysql/init_nuxeo_db.sql
index e5e21b2b8b5e31eead54a0463675a03787114701..d482a9bff6a16ec04f0390a10f2d678fa618e57a 100644 (file)
@@ -1,44 +1,24 @@
---\r
--- delete all users\r
---\r
--- DELETE FROM mysql.user WHERE NOT (host="localhost" and user="root");\r
--- FLUSH PRIVILEGES;\r
-\r
---\r
--- delete anonymous access\r
---\r
-DELETE FROM mysql.user WHERE User = '';\r
-FLUSH PRIVILEGES;\r
-\r
---\r
--- recreate cspace database\r
---\r
-DROP database IF EXISTS cspace;\r
-CREATE database cspace DEFAULT CHARACTER SET utf8;\r
-\r
---\r
--- recreate nuxeo database\r
---\r
-DROP database IF EXISTS nuxeo;\r
-CREATE database nuxeo DEFAULT CHARACTER SET utf8;\r
-\r
-\r
---\r
--- grant privileges to users on nuxeo and cspace databases\r
---\r
-GRANT ALL PRIVILEGES ON cspace.* TO '@DB_CSPACE_USER@'@'localhost' IDENTIFIED BY '@DB_CSPACE_PASSWORD@' WITH GRANT OPTION;\r
-FLUSH PRIVILEGES;\r
-GRANT ALL PRIVILEGES ON nuxeo.* TO '@DB_NUXEO_USER@'@'localhost' IDENTIFIED BY '@DB_NUXEO_PASSWORD@' WITH GRANT OPTION;\r
---\r
--- Grant privileges to read-only user on Nuxeo, for reporting. \r
---\r
-GRANT SELECT ON nuxeo.* TO 'reader'@'localhost' IDENTIFIED BY 'read';\r
---\r
--- Grant privileges to remote read-only users on Nuxeo, for reporting. \r
--- These should be changed to reflect your domain. Avoid specifying\r
--- 'reader'@'%' (while simple and flexible, this is a potential security hole).\r
---\r
-GRANT SELECT ON nuxeo.* TO 'reader'@'%.berkeley.edu' IDENTIFIED BY 'read';\r
-GRANT SELECT ON nuxeo.* TO 'reader'@'%.movingimage.us' IDENTIFIED BY 'read';\r
-FLUSH PRIVILEGES;\r
-\r
+--
+-- recreate nuxeo database
+--
+DROP database IF EXISTS nuxeo;
+CREATE database nuxeo DEFAULT CHARACTER SET utf8;
+
+
+--
+-- grant privileges to users on nuxeo database
+--
+GRANT ALL PRIVILEGES ON nuxeo.* TO '@DB_NUXEO_USER@'@'localhost' IDENTIFIED BY '@DB_NUXEO_PASSWORD@' WITH GRANT OPTION;
+--
+-- Grant privileges to read-only user on Nuxeo, for reporting. 
+--
+GRANT SELECT ON nuxeo.* TO 'reader'@'localhost' IDENTIFIED BY 'read';
+--
+-- Grant privileges to remote read-only users on Nuxeo, for reporting. 
+-- These should be changed to reflect your domain. Avoid specifying
+-- 'reader'@'%' (while simple and flexible, this is a potential security hole).
+--
+GRANT SELECT ON nuxeo.* TO 'reader'@'%.berkeley.edu' IDENTIFIED BY 'read';
+GRANT SELECT ON nuxeo.* TO 'reader'@'%.movingimage.us' IDENTIFIED BY 'read';
+FLUSH PRIVILEGES;
+
diff --git a/src/main/resources/db/postgresql/init_cspace_db.sql b/src/main/resources/db/postgresql/init_cspace_db.sql
new file mode 100644 (file)
index 0000000..2bd0209
--- /dev/null
@@ -0,0 +1,11 @@
+-- drop all the objects before dropping roles
+DROP database IF EXISTS cspace;
+
+DROP USER IF EXISTS cspace;
+
+CREATE ROLE @DB_CSPACE_USER@ WITH PASSWORD '@DB_CSPACE_PASSWORD@' LOGIN;
+
+--
+-- recreate cspace database
+--
+CREATE DATABASE cspace ENCODING 'UTF8' OWNER @DB_CSPACE_USER@;
similarity index 69%
rename from src/main/resources/db/postgresql/init_db.sql
rename to src/main/resources/db/postgresql/init_nuxeo_db.sql
index 29d3658bd6f1152b19bd7a24f111bad1bb8491b2..92648440b9c6c98567dcf336331cc50266a56d09 100644 (file)
@@ -1,27 +1,23 @@
--- drop all the objects before dropping roles\r
-DROP database IF EXISTS cspace;\r
-DROP database IF EXISTS nuxeo;\r
-\r
-DROP USER IF EXISTS nuxeo;\r
-DROP USER IF EXISTS cspace;\r
-DROP USER IF EXISTS reader;\r
-\r
-CREATE ROLE @DB_NUXEO_USER@ WITH PASSWORD '@DB_NUXEO_PASSWORD@' LOGIN;\r
-CREATE ROLE @DB_CSPACE_USER@ WITH PASSWORD '@DB_CSPACE_PASSWORD@' LOGIN;\r
-CREATE ROLE reader WITH PASSWORD 'read' LOGIN;\r
-\r
---\r
--- recreate jbossdb, cspace, and nuxeo databases\r
---\r
-CREATE DATABASE cspace ENCODING 'UTF8' OWNER @DB_CSPACE_USER@;\r
-CREATE DATABASE nuxeo ENCODING 'UTF8' OWNER @DB_NUXEO_USER@;\r
-\r
---\r
--- Grant privileges to read-only user on Nuxeo, for reporting. \r
---\r
-GRANT CONNECT ON DATABASE nuxeo TO reader;\r
-\r
--- GRANT SELECT ON ALL TABLES IN SCHEMA public TO reader;\r
--- This must be run by hand, after the system has already started up,\r
--- so that it gives access to all the tables created on init.\r
-\r
+-- drop all the objects before dropping roles
+DROP database IF EXISTS nuxeo;
+
+DROP USER IF EXISTS nuxeo;
+DROP USER IF EXISTS reader;
+
+CREATE ROLE @DB_NUXEO_USER@ WITH PASSWORD '@DB_NUXEO_PASSWORD@' LOGIN;
+CREATE ROLE reader WITH PASSWORD 'read' LOGIN;
+
+--
+-- recreate nuxeo database
+--
+CREATE DATABASE nuxeo ENCODING 'UTF8' OWNER @DB_NUXEO_USER@;
+
+--
+-- Grant privileges to read-only user on Nuxeo, for reporting. 
+--
+GRANT CONNECT ON DATABASE nuxeo TO reader;
+
+-- GRANT SELECT ON ALL TABLES IN SCHEMA public TO reader;
+-- This must be run by hand, after the system has already started up,
+-- so that it gives access to all the tables created on init.
+