#!/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 "Removing Manage Sites Functionality since it's not used anymore" removeManageSitesFunctionality.sql execute "Fixing node content IDs, which is missing in a few" fixNodeContentId.sql execute "Creating Functionality Calls and doing the data migration" createFunctionalityCalls.sql execute "Altering Initial Contents" alterInitialContents.sql execute "Alter AcademicServiceRequest table" AlterTableAcademicServiceRequest.sql execute "Clear OJB_HL_SEQ table because the above scripts inserted data manually thus occupying unregistered ids" clearOJBids.sql