#!/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 "Create DegreeContext Table" createDegreeContextTable.sql execute "Institutional Deppend modification" editPermissionsForInstitutionBoards.sql execute "Add AssiduousnessStatus functionality" addAssiduousnessStatusFunctionality.sql execute "Add export vacations functionality.sql" addExportVacationsFunctionality.sql execute "Alter Table AssiduousnessVacations" alterTableAssiduousnessVacations.sql execute "Alter Table AssiduousnessClosedMonth" alterTableAssiduousnessClosedMonth.sql execute "Create Table AssiduousnessExemption" createTableAssiduousnessExemption.sql execute "Alter Table AnualBonusInstallment" alterTableAnualBonusInstallment.sql execute "Add AssiduousnessExemptionsFunctionality" addAssiduousnessExemptionsFunctionality.sql execute "Add vacations functionalities" addVacationsFunctionalities.sql execute "Update sql structure" updates.sql