Skip to content

Commit

Permalink
Instructions for updating a database
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlLevik committed Aug 28, 2019
1 parent 0e07ccd commit 3a368a7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a368a7

Please sign in to comment.