#!/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 } executeWithTempFile "./../R2007-03-02/createTableExpectationEvaluationGroup.sql" ./../R2007-03-02/createTableExpectationEvaluationGroup.sql executeWithTempFile "./../R2007-03-02/moveExpectationsPeriodsToNewTable.sql" ./../R2007-03-02/moveExpectationsPeriodsToNewTable.sql executeWithTempFile "./../R2007-03-02/removeOldPeriodsTables.sql" ./../R2007-03-02/removeOldPeriodsTables.sql executeWithTempFile "./../R2007-03-02/alterTableAssiduousnessClosedMonth.sql" ./../R2007-03-02/alterTableAssiduousnessClosedMonth.sql executeWithTempFile "./../R2007-03-02/FixDFACandidacyPostingRules.sql" ./../R2007-03-02/FixDFACandidacyPostingRules.sql executeWithTempFile "./../R2007-03-02/createEmailTable.sql" ./../R2007-03-02/createEmailTable.sql executeWithTempFile "./../R2007-03-02/alterTableWorkScheduleType.sql" ./../R2007-03-02/alterTableWorkScheduleType.sql executeWithTempFile "./../R2007-03-03/alterTableCurriculumModule.sql" ./../R2007-03-03/alterTableCurriculumModule.sql executeWithTempFile "./../R2007-03-05/ResearchModifications.sql" ./../R2007-03-05/ResearchModifications.sql executeWithTempFile "./../R2007-03-07/eventNameToString.sql" ./../R2007-03-07/eventNameToString.sql executeWithTempFile "./../R2007-03-07/CreateThesis.sql" ./../R2007-03-07/CreateThesis.sql executeWithTempFile "./../R2007-03-07/createDocumentIDTables.sql" ./../R2007-03-07/createDocumentIDTables.sql executeWithTempFile "./../R2007-03-07/changes-20070307165400.sql" ./../R2007-03-07/changes-20070307165400.sql executeWithTempFile "./../R2007-03-07/createEmailAddressTable.sql" ./../R2007-03-07/createEmailAddressTable.sql executeWithTempFile "./../R2007-03-09/alterResult.sql" ./../R2007-03-09/alterResult.sql executeWithTempFile "./../R2007-03-09/addDegreeTypeToCourseGroup.sql" ./../R2007-03-09/addDegreeTypeToCourseGroup.sql execute "Initialize begin date in bolonha degree curricular plans" InitializeBolonhaDCPInitialDates.sql