From 3a368a7f93637a64f5e3d5d4a6d68804d4c2f03a Mon Sep 17 00:00:00 2001 From: Karl Levik Date: Wed, 28 Aug 2019 11:24:16 +0100 Subject: [PATCH] Instructions for updating a database --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index dd48cd34..9aa94e9f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,25 @@ You can verify that it's installed and activated with: SHOW PLUGINS SONAME WHERE Name = 'SQL_ERROR_LOG'; ``` +## Updating + +In order to update a production database, please follow this procedure: + +1. For all .sql files in `schema/updates` that have not already been run, read any comments inside the files to decide if you should run them. Run a file e.g. like this: +```bash +mysql ispyb < schema/updates/2019_03_29_BLSession_archived.sql +``` +2. If it's been updated, run `schema/routines.sql`. E.g.: +```bash +mysql ispyb < schema/routines.sql +``` +3. If you ran the routines.sql, then re-apply the grants for the routines. E.g.: +```bash +mysql ispyb < grants/ispyb_acquisition.sql +mysql ispyb < grants/ispyb_processing.sql +mysql ispyb < grants/ispyb_web.sql +``` + ## Documentation * Please refer to the [```Wiki```](https://github.com/DiamondLightSource/ispyb-database/wiki) for database diagrams, stored procedure how-to, MariaDB installation and more