fix for postgres scripts
- create user not asking for password in ImportAdempiere - create DBExport for windows (ask for password)
This commit is contained in:
parent
7a772cb5c8
commit
b1f327872a
|
@ -0,0 +1,28 @@
|
||||||
|
@Echo ADEMPIERE Database Export $Revision: 1.2 $
|
||||||
|
|
||||||
|
@Rem $Id: DBExport.bat,v 1.2 2005/01/22 21:59:15 jjanke Exp $
|
||||||
|
|
||||||
|
@Echo Saving database %1@%ADEMPIERE_DB_NAME% to %ADEMPIERE_HOME%\data\ExpDat.dmp
|
||||||
|
|
||||||
|
@if (%ADEMPIERE_HOME%) == () goto environment
|
||||||
|
@if (%ADEMPIERE_DB_NAME%) == () goto environment
|
||||||
|
@Rem Must have parameter: userAccount
|
||||||
|
@if (%1) == () goto usage
|
||||||
|
|
||||||
|
pg_dump -U %1 %ADEMPIERE_DB_NAME% > %ADEMPIERE_HOME%\data\ExpDat.dmp
|
||||||
|
|
||||||
|
@cd %ADEMPIERE_HOME%\Data
|
||||||
|
@jar cvfM ExpDat.jar ExpDat.dmp
|
||||||
|
|
||||||
|
@goto end
|
||||||
|
|
||||||
|
:environment
|
||||||
|
@Echo Please make sure that the enviroment variables are set correctly:
|
||||||
|
@Echo ADEMPIERE_HOME e.g. D:\ADEMPIERE2
|
||||||
|
@Echo ADEMPIERE_DB_NAME e.g. ADEMPIERE.ADEMPIERE.org
|
||||||
|
|
||||||
|
:usage
|
||||||
|
@echo Usage: %0 <userAccount>
|
||||||
|
@echo Examples: %0 ADEMPIERE/ADEMPIERE
|
||||||
|
|
||||||
|
:end
|
|
@ -18,7 +18,7 @@ if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pg_dump $ADEMPIERE_DB_NAME > $ADEMPIERE_HOME/data/ExpDat.dmp
|
pg_dump -U $1 $ADEMPIERE_DB_NAME > $ADEMPIERE_HOME/data/ExpDat.dmp
|
||||||
|
|
||||||
cd $ADEMPIERE_HOME/data
|
cd $ADEMPIERE_HOME/data
|
||||||
jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log
|
jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
@echo -------------------------------------
|
@echo -------------------------------------
|
||||||
@dropdb -U postgres %ADEMPIERE_DB_NAME%
|
@dropdb -U postgres %ADEMPIERE_DB_NAME%
|
||||||
@dropuser -U postgres %ADEMPIERE_DB_USER%
|
@dropuser -U postgres %ADEMPIERE_DB_USER%
|
||||||
@createuser -U postgres -a -d %ADEMPIERE_DB_USER%
|
@createuser -U postgres -a -d %ADEMPIERE_DB_USER% -P
|
||||||
@createdb %ADEMPIERE_DB_NAME% -E UNICODE -O %ADEMPIERE_DB_USER% -U %ADEMPIERE_DB_USER%
|
@createdb %ADEMPIERE_DB_NAME% -E UNICODE -O %ADEMPIERE_DB_USER% -U %ADEMPIERE_DB_USER%
|
||||||
|
|
||||||
@echo -------------------------------------
|
@echo -------------------------------------
|
||||||
|
|
|
@ -25,7 +25,7 @@ dropdb -U postgres $ADEMPIERE_DB_NAME
|
||||||
|
|
||||||
dropuser -U postgres $ADEMPIERE_DB_USER
|
dropuser -U postgres $ADEMPIERE_DB_USER
|
||||||
|
|
||||||
createuser -U postgres -a -d $ADEMPIERE_DB_USER
|
createuser -U postgres -a -d $ADEMPIERE_DB_USER -P
|
||||||
|
|
||||||
createdb $ADEMPIERE_DB_NAME -E UNICODE -O $ADEMPIERE_DB_USER -U $ADEMPIERE_DB_USER
|
createdb $ADEMPIERE_DB_NAME -E UNICODE -O $ADEMPIERE_DB_USER -U $ADEMPIERE_DB_USER
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue