#!/bin/sh # ----------------------------------------------------------------------------- # # Runs sql scripts to update database from previous release. # # ----------------------------------------------------------------------------- # echo Using database: $1 echo Enter password for $2: read -s password # Authorship scripts mysql -u$2 -f $1 < CreateStudentPersonalDataAuthorizationTable.sql mysql -u$2 -f $1 < alterTableStudent.sql mysql -u$2 -f $1 < AlterOnlineTestsTables.sql mysql -u$2 -f $1 < CreateTableDislocatedStudent.sql mysql -u$2 -f $1 < CreateTableDistrict.sql mysql -u$2 -f $1 < insertsIntoDistrict.sql # Group scrips echo Starting Group Scripts ... echo - AlterGroupTables mysql -u$2 -f $1 < alterGroupTables.sql echo - UpdateStudentGroupWithGrouping mysql -u$2 -f $1 < updateStudentGroupWithGrouping.sql > res mysql -u$2 -f $1 < res echo - UpdateGroupingAttendWithGrouping mysql -u$2 -f $1 < updateGroupingAttendWithGrouping.sql > res mysql -u$2 -f $1 < res echo - AlterGroupTablesAfterUpdates mysql -u$2 -f $1 < alterGroupTablesAfterUpdates.sql echo Removing Temporary files rm -r res echo Group scrips completed.