[Bedework-commit] r492 - in trunk/calendar3: . deployment/dumprestore/shellscr/resources

svnadmin at bedework.org svnadmin at bedework.org
Thu May 18 11:04:06 EDT 2006


Author: douglm
Date: 2006-05-18 11:04:06 -0400 (Thu, 18 May 2006)
New Revision: 492

Modified:
   trunk/calendar3/build.xml
   trunk/calendar3/deployment/dumprestore/shellscr/resources/dumpres.sh
Log:
Add schema and scheam-export to the runnable dump/restore shell script

Modified: trunk/calendar3/build.xml
===================================================================
--- trunk/calendar3/build.xml	2006-05-18 14:22:50 UTC (rev 491)
+++ trunk/calendar3/build.xml	2006-05-18 15:04:06 UTC (rev 492)
@@ -661,6 +661,9 @@
 
   <target name="schema" depends="init"
           description="Generate schema from mapping files">
+    <echo message="Creating a schema is also available from the generated stand-alone" />
+    <echo message="scripts using the 'schema' or 'schema-export' parameter" />
+
     <input message="text only? no will update db with new schema "
            validargs="yes,no"
            addproperty="schema.text.only" />

Modified: trunk/calendar3/deployment/dumprestore/shellscr/resources/dumpres.sh
===================================================================
--- trunk/calendar3/deployment/dumprestore/shellscr/resources/dumpres.sh	2006-05-18 14:22:50 UTC (rev 491)
+++ trunk/calendar3/deployment/dumprestore/shellscr/resources/dumpres.sh	2006-05-18 15:04:06 UTC (rev 492)
@@ -10,6 +10,7 @@
 
 DUMPCMD="$JAVA_HOME/bin/java -cp $cp @DUMP-CLASS@"
 RESTORECMD="$JAVA_HOME/bin/java -cp $cp @RESTORE-CLASS@"
+SCHEMACMD="$JAVA_HOME/bin/java -cp $cp org.hibernate.tool.hbm2ddl.SchemaExport"
 
 APPNAME=@BW-APP-NAME@
 
@@ -31,7 +32,20 @@
     echo $RESTORECMD -appname $APPNAME -f ./data/initbedework.xml -initSyspars
     $RESTORECMD -appname $APPNAME -f ./data/initbedework.xml -initSyspars
     ;;
+  schema)
+    echo $SCHEMACMD --text --create --config=./classes/hibernate.cfg.xml --output=schema.sql
+    $SCHEMACMD --text --create --config=./classes/hibernate.cfg.xml --output=schema.sql
+    ;;
+  schema-export)
+    echo $SCHEMACMD --create --config=./classes/hibernate.cfg.xml --output=schema.sql
+    $SCHEMACMD --create --config=./classes/hibernate.cfg.xml --output=schema.sql
+    ;;
   *)
-    echo $"Usage: $0 {dump <filename>|restore <filename>|backup <directory> <prefix>} || initdb"
+    echo $"Usage: $0 {dump <filename> |"
+    echo $"           restore <filename> |"
+    echo $"           backup <directory> <prefix>} |"
+    echo $"           initdb |"
+    echo $"           schema |"
+    echo $"           schema-export"
 esac
 



More information about the Bedework-commit mailing list