#!/bin/bash # ----------------------------------------------------------------------------- # # 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 "Fix Scientific Area Site Concrete Class" fixScientificAreaSiteConcreteClass.sql execute "Create table for Content and Node" createContentAndNodeTable.sql execute "Prepare Contents for items and sections" prepareContentsForItemsAndSections.sql execute "Update sql structure for and migrate data." updates.sql execute "Preparing Forums" prepareForum.sql execute "Prepare ConversionThread" prepareConversationThread.sql execute "Prepare ConversationMessage" prepareConversationMessage.sql execute "Prepare Contents" prepareContents.sql execute "Prepare Node" prepareNode.sql execute "Migrate Foruns" migrateForuns.sql execute "Migrate functionalities to Content table" mergeFunctionalityInContent.sql execute "Create functionality parameter table" createFunctionalityParameter.sql execute "Create root module" connectRootModule.sql execute "Create portal" createPortal.sql execute "Create root portal" connectRootPortal.sql execute "Migrate sites" migrateSites.sql execute "Migrate sections and items" migrateSectionsAndItems.sql execute "Move TempSections to Sections" moveTempSectionsToSections.sql execute "Create execution path for functionalities" createExecutionPathTable.sql execute "Copy Module Structure" copyModuleStructure.sql execute "Create missing Modules" createMissingModules.sql execute "Create table for MetaDomainObject" metaDomainObject.sql execute "Adding meta domain objects for all defined types" addMetaDomainObject3.sql execute "Update missing information in site" updateMissingInformationInSites.sql execute "Create MetaDomainObjhect From Site Templates" createMetaDomainObjectsFromSiteTemplates.sql execute "Update Roles" updateRole.sql execute "Migrate Top Sections, esta esqueci-me depois aquando merge pode-se juntar com o migrateSectionsAndItems" migrateTopSections.sql execute "Criar chave da Pool, este scripts pode depois ser merged na criação da tabela meta domain object" createKeysForPool.sql execute "Associar os conteúdos às pools. Com algum cuidado tb deverá ser merged na criação da tabela meta domain object" createPools.sql execute "Initialize portal stuff from modules." initPortals.sql execute "Initialize old portals" initiateOldPortals.sql execute "Naming Portals" namePortals.sql execute "Add content ID to EVERYTHING!!!" addContentId.sql execute "Add Attachment" addAttachment.sql executeWithTempFile "Add Attachment2" addAttachment2.sql execute "Add Attachment3" addAttachment3.sql execute "Connect ExecutionCourseForum to ExecutionCourseSite" connectExecutionCourseForumToExecutionCourseSite.sql execute "Removing invalid availability policy" removeAvailabilityPolicyFromHomepagePortal.sql execute "Fixing some groups" fixAnnouncementsWRitersGroups.sql execute "Create new Teacher Service Distribution tables definitions" newTSDTableDefinitions.sql execute "Create UnitAcronym" createUnitAcronym.sql execute "Create missing functionalities" generateMissingPresentationFunctionalities.sql execute "Migrate Functionalities in Sites" migrateFunctionalitiesInSites.sql execute "Initializing portal structure" generateTemplatePortalsStructure.sql execute "Initialize Pools" initializePools.sql execute "Fix assiduiness Policies" fixAssiduinessPolicies.sql execute "Fix &s; in functionalities" fixAmpsInExecutionPaths.sql execute "Create Treasury Initial Page" createTreasuryInitialPage.sql execute "Populate Execution path table" populateExecutionPathTable.sql execute "Removing Slashs from content Names" removeSlashFromContentNames.sql execute "Fix Manager Menu" fixManagerMenu.sql execute "Fix Departments Initial Structure" fixDeparments.sql execute "Add missing keys." addMissingIndexes.sql