#!/bin/sh # ----------------------------------------------------------------------------- # # Runs sql scripts to update database from previous release. # # ----------------------------------------------------------------------------- # echo Using database: $1 echo Enter password for $2: read -s password # Fix Scripts echo Changing Evaluation Table ... started mysql -u$2 -f $1 -p$password < alterTableEvaluation.sql echo Changing Evaluation Table ... completed echo Fixing Person_Role table ... started mysql -u$2 -f $1 -p$password < updatePersonRole.sql > res mysql -u$2 -f $1 -p$password < res rm -r res echo Fixing Person_Role table ... completed echo Altering Inquiries Tables ... started mysql -u$2 -f $1 -p$password < AlterTablesInquiries.sql echo Altering Inquiries Tables ... completed echo Preparing Tables for Department Portal... started mysql -u$2 -f $1 -p$password < createTableTeacherPersonalExpectation.sql mysql -u$2 -f $1 -p$password < AlterTableRoleUpdateDeptAdminOfficeRole.sql mysql -u$2 -f $1 -p$password < InsertDepartmentMemberRole.sql echo Preparing Tables for Department Portal... completed echo Preparing Tables Unit and Function... started mysql -u$2 -f $1 -p$password < createContractTable.sql mysql -u$2 -f $1 -p$password < alterTableUnit.sql mysql -u$2 -f $1 -p$password < createFunctionTable.sql mysql -u$2 -f $1 -p$password < createPersonFunctionTable.sql mysql -u$2 -f $1 -p$password < addDepartmentRealNames.sql mysql -u$2 -f $1 -p$password < alterTableFunction.sql echo Preparing Tables Unit and Function... completed echo Updating SCP data mysql -u$2 -f $1 -p$password < updateStudentCurricularPlanDate.sql echo finished