#!/bin/bash # ----------------------------------------------------------------------------- # # Runs sql scripts to update database from previous release. # # ----------------------------------------------------------------------------- # DB=$1 USER=$2 DB_HOST=$3 echo Using host=$DB_HOST echo Using database: $DB echo Using user $USER: function execute() { echo ---------------------------------------- $1 mysql -u$USER -f -h$DB_HOST --default-character-set=latin1 $DB < $2 echo } function executeWithTempFile() { echo ---------------------------------------- $1 mysql -u$USER -f -h$DB_HOST --default-character-set=latin1 $DB < $2 > tmp.sql mysql -u$USER -f -h$DB_HOST --default-character-set=latin1 $DB < tmp.sql rm tmp.sql echo } execute "add creation date column to AcademicServiceRequest" AlterTableAcademicServiceRequest.sql execute "add situation date column to AcademicServiceRequestSituation" AlterTableAcademicServiceRequestSituation.sql execute "Please delete this after running" dataFix.sql execute "Adding column key execution period to event table" AlterTableEvent.sql execute "Adding enrolment out of period posting rule fields" AlterTablePostingRule.sql