#!/bin/sh # ----------------------------------------------------------------------------- # # Runs sql scripts to update database from previous release. # # ----------------------------------------------------------------------------- # DB=$1 USER=$2 echo Using database: $DB echo Enter password for $USER: read -s password function execute() { echo $1 mysql -u$USER -f -p$password --default-character-set=latin1 $DB < $2 echo } function executeWithTempFile() { echo $1 mysql -u$USER -f -p$password --default-character-set=latin1 $DB < $2 > tmp.sql mysql -u$USER -f -p$password --default-character-set=latin1 $DB < tmp.sql rm tmp.sql echo } execute "Adding a column BASIC_BIBLIOGRAPHIC_REFERENCE and COMPLEMENTAR_BIBLIOGRAPHIC_REFERENCE to COMPETENCE_COURSE_INFORMATION table." AddBasicAndComplementarBibliographicReferences.sql execute "Change columns names PRE_REQUIREMENTS and PRE_REQUIREMENTS_EN to PRE_REQUISITES and PRE_REQUISITES_EN in COMPETENCE_COURSE_INFORMATION table." ChangeColumnNameInCompetenceCourseInformation.sql execute "Adding Number of Weeks Columns to Execution Course . " AddNumberOfWeeksColumnsToExecutionCourse.sql execute "Updating table EXECUTION_COURSE . " UpdateExecutionCourseWeekFields.sql