|
From: Benjamin C. <bc...@us...> - 2001-10-12 13:44:03
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv4702
Modified Files:
configure_db
Log Message:
All new and improved update schema files!
Index: configure_db
===================================================================
RCS file: /cvsroot/phpbt/phpbt/configure_db,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- configure_db 2001/09/24 08:07:59 1.7
+++ configure_db 2001/10/12 13:43:59 1.8
@@ -6,11 +6,16 @@
#TBL_PREFIX="phpbt_"
TBL_PREFIX=''
DB_TYPE='mysql'
+VERSION='.0.3.x-0.4.0'
+UPGRADE=''
#------------------------------------------------------------------------------
help() {
echo "usage $0 -h|--help"
- echo " $0 [-t <db-type>] [-p <table-prefix>]"
+ echo " $0 [-t <db-type>] [-p <table-prefix>] [-u]"
+ echo ""
+ echo " -u: Used for upgrading from the previous major version (if applicable)"
+ echo ""
} #end help()
#------------------------------------------------------------------------------
@@ -27,6 +32,7 @@
s/TBL_BUG/${TBL_PREFIX}bug/g
s/TBL_COMMENT/${TBL_PREFIX}comment/g
s/TBL_COMPONENT/${TBL_PREFIX}component/g
+ s/TBL_CONFIGURATION/${TBL_PREFIX}configuration/g
s/TBL_PROJECT/${TBL_PREFIX}project/g
s/TBL_RESOLUTION/${TBL_PREFIX}resolution/g
s/TBL_SAVED_QUERY/${TBL_PREFIX}saved_query/g
@@ -48,6 +54,12 @@
#------------------------------------------------------------------------------
#parse commandline arguments
+
+if [ $# -eq 0 ];
+then
+ EXTRAHELP=" For help, run $0 -h"
+fi
+
while [ $# -gt 0 ]; do
case $1
in
@@ -69,6 +81,10 @@
fi
shift;;
+ '-u') #upgrading
+ UPGRADE=$VERSION
+ shift;;
+
'-h'|'--help')
help
exit 0;;
@@ -80,4 +96,6 @@
#------------------------------------------------------------------------------
#generate SQL file
-generate_sql schemas/$DB_TYPE.in createdb.sql
+generate_sql schemas/$DB_TYPE$UPGRADE.in createdb.sql
+echo $EXTRAHELP
+echo "Created $DB_TYPE schema file createdb.sql."
|