Eli Mesika has uploaded a new change for review.

Change subject: core: [db] include version in exportDbSchema.sh...
......................................................................

core: [db] include version in exportDbSchema.sh...

[db] include version in exportDbSchema.sh output

This patch adds the latest database version installed to the file name
such that file name is in the format .<dn_name>.<version>.schema

Change-Id: I5f643c170bf14f2a4395b726a3c00909893f1c36
Signed-off-by: Eli Mesika<[email protected]>
---
M packaging/dbscripts/exportDbSchema.sh
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/72/16272/1

diff --git a/packaging/dbscripts/exportDbSchema.sh 
b/packaging/dbscripts/exportDbSchema.sh
index a17e69b..41fe710 100755
--- a/packaging/dbscripts/exportDbSchema.sh
+++ b/packaging/dbscripts/exportDbSchema.sh
@@ -39,9 +39,12 @@
     esac
 done
 
-pg_dump -f .${DATABASE}.schema -F p -n public -s -U ${USERNAME} ${DATABASE} -h 
${SERVERNAME} -p ${PORT}  >& /dev/null
+CMD="select version from schema_version where current;"
+VERSION=$(execute_command "$CMD" ${DATABASE} ${SERVERNAME} ${PORT} | sed 's/^ 
*//g')
+FILE=".${DATABASE}.${VERSION}.schema"
+pg_dump -f "${FILE}" -F p -n public -s -U ${USERNAME} ${DATABASE} -h 
${SERVERNAME} -p ${PORT}  >& /dev/null
 
 printf "Done.\n"
-printf "Exported file is .${DATABASE}.schema.\n"
+printf "Exported file is ${FILE}.\n"
 popd>/dev/null
 exit 0


-- 
To view, visit http://gerrit.ovirt.org/16272
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f643c170bf14f2a4395b726a3c00909893f1c36
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to