diff --git a/openbis/resource/scripts/common.sh b/openbis/resource/scripts/common.sh index 3c220deefde38b9b97ebd87af97e0f5af957d172..015808c6b649e0c9480317b9f67303a821c51d83 100755 --- a/openbis/resource/scripts/common.sh +++ b/openbis/resource/scripts/common.sh @@ -1,8 +1,7 @@ #!/bin/bash # Author: Tomasz Pylak # Scripts to create new database version, common to all projects. - -SQL_DIR=../../source/sql/ +# Requires setting SQL_DIR variable before being inlined! PREV_NUM=`ls -1 $SQL_DIR/postgresql | grep 0 | sort | tail -n 1 | sed s/^0*//g` PREV_VER=`printf "%03d" $PREV_NUM` diff --git a/openbis/resource/scripts/create_new_db_version.sh b/openbis/resource/scripts/create_new_db_version.sh index f53452092d8206b3d7294ef2fcef42b342f96caa..ae24f5ff579919419c6526b00f6de63f2f30c295 100755 --- a/openbis/resource/scripts/create_new_db_version.sh +++ b/openbis/resource/scripts/create_new_db_version.sh @@ -3,9 +3,10 @@ # Creates new database version (all sql files) which is identical to the previous version. # Assumes that it is called from the directory where it is located. +SQL_DIR=../../source/sql/ source common.sh copy_db_folder generic copy_db_folder postgresql copy_migration_file -print_finish_message \ No newline at end of file +print_finish_message