From e2d293d0759b15b31f15728c9ee6ba46f6bdd78c Mon Sep 17 00:00:00 2001
From: Sinisa Veseli <sveseli@aps.anl.gov>
Date: Tue, 30 Sep 2014 12:57:24 +0000
Subject: [PATCH] population scripts for users and experiment types

---
 sbin/create_dm_db.sh | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/sbin/create_dm_db.sh b/sbin/create_dm_db.sh
index b681273b..32e95cfa 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"
-- 
GitLab