#!/bin/sh # ----------------------------------------------------------------------------- # # Runs sql scripts to update database from previous release. # # ----------------------------------------------------------------------------- # DB=$1 USER=$2 echo Using database: $DB echo Enter password for $USER: read -s password function execute() { echo ---------------------------------------- $1 mysql -u$USER -f -p$password $DB < $2 echo } execute "Create table weekly work load" createTableWeeklyWorkLoad.sql execute "Create researcher role" createResearcherRole.sql echo ---------------------------------------- Altering table Person_Role mysql -u$2 -f -p$password $1 < setResearcherRole2Teachers.sql > res.sql mysql -u$2 -f -p$password $1 < res.sql rm res.sql echo done