diff --git a/sbin/create_dm_db.sh b/sbin/create_dm_db.sh index b681273b68841d37bdeecf6e874e7cdcc45bafcc..32e95cfa6d146642efd109541f4fe73cd0f85976 100755 --- a/sbin/create_dm_db.sh +++ b/sbin/create_dm_db.sh @@ -176,16 +176,18 @@ createDb || exit 1 # populate db cd $CURRENT_DIR && cd $DM_DB_SCRIPTS_DIR DM_DB_TABLES="\ + experiment_type \ + user_info \ " -#for dbTable in $DM_DB_TABLES; do -# dbFile=populate_$dbTable.sql -# if [ -f $dbFile ]; then -# echo "Populating $dbTable using $dbFile script" -# execute $mysqlCmd $dbFile -# else -# echo "$dbFile not found, skipping $dbTable update" -# fi -#done +for dbTable in $DM_DB_TABLES; do + dbFile=populate_$dbTable.sql + if [ -f $dbFile ]; then + echo "Populating $dbTable using $dbFile script" + execute ${PG_DIR}/bin/psql -U $DM_DB_USER -h $DM_DB_HOST -p $DM_DB_PORT -d $DM_DB_NAME -f $dbFile || exit 1 + else + echo "$dbFile not found, skipping $dbTable update" + fi +done # cleanup echo "Restoring db access permissions"