#!/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 $DB < $2 echo } function executeWithTempFile() { echo ---------------------------------------- $1 mysql -u$USER -f -p$password $DB < $2 > tmp.sql mysql -u$USER -f -p$password $DB < tmp.sql rm tmp.sql echo } execute "Add column KEY_PARTY to Event table" alterTableAccountingEvent.sql execute "Add column KEY_RECEIPT to Entry table" alterTableAccountingEntry.sql execute "Create table Receipt" createTableReceipt.sql execute "Rename table File Item to File" RenameTableFileItemToFile.sql execute "Changing table File" AlterTableFile.sql execute "Creating Project Submission Tables" CreateProjectSubmissionTables.sql execute "Changing table Evaluation" AlterTableEvaluation.sql