Permalink
Browse files

Upgrade instructions

  • Loading branch information...
1 parent df8fa97 commit 888b486853f8c7fd155d170fa38d085b29be15d6 @lalinsky committed Oct 14, 2012
Showing with 41 additions and 2 deletions.
  1. +38 −0 README.md
  2. +3 −2 mbslave-remap-schema.py
View
@@ -143,6 +143,44 @@ grep 'CREATE VIEW' sql/CreateSimpleViews.sql | sed 's/CREATE/DROP/' | sed 's/ AS
echo "UPDATE replication_control SET current_schema_sequence = 15;" | ./mbslave-psql.py
```
+### Release 2012-10-15
+
+This release introduces two new database schemas. You can decide whether you want
+to have the three schemas in your database, or if you want to merge them. For this
+you need to update your `mbslave.conf` configuration file. The rest of the guide
+will assume that you will keep have all schemas.
+
+Create the cover_art_archive schema:
+
+```sh
+echo 'CREATE SCHEMA cover_art_archive;' | ./mbslave-psql.py -S
+./mbslave-remap-schema.py <sql/caa/CreateTables.sql | ./mbslave-psql.py
+wget http://ftp.musicbrainz.org/pub/musicbrainz/data/schema-change-2012-10-15/mbdump-cover-art-archive.tar.bz2
+./mbslave-import.py mbdump-cover-art-archive.tar.bz2
+./mbslave-remap-schema.py <sql/caa/CreatePrimaryKeys.sql | ./mbslave-psql.py
+./mbslave-remap-schema.py <sql/caa/CreateIndexes.sql | ./mbslave-psql.py
+```
+
+Move tables to the statistics schema:
+
+```sh
+./mbslave-remap-schema.py <sql/updates/20120922-move-statistics-tables.sql | ./mbslave.py
+```
+
+Upgrade the musicbrainz schema:
+
+```sh
+grep 'CREATE VIEW' sql/CreateSimpleViews.sql | sed 's/CREATE/DROP/' | sed 's/ AS/;/' | ./mbslave-psql.py
+./mbslave-psql.py <sql/updates/20120220-merge-duplicate-credits.sql
+./mbslave-psql.py <sql/updates/20120822-more-text-constraints.sql
+./mbslave-psql.py <sql/updates/20120917-rg-st-created.sql
+./mbslave-psql.py <sql/updates/20120921-drop-url-descriptions.sql
+./mbslave-psql.py <sql/updates/20120927-add-log-statistics.sql
+./mbslave-psql.py <sql/updates/20120911-not-null-comments.sql
+./mbslave-psql.py <sql/CreateSimpleViews.sql
+echo "UPDATE replication_control SET current_schema_sequence = 16;" | ./mbslave-psql.py
+```
+
## Solr Search Index (Work-In-Progress)
If you would like to also build a Solr index for searching, mbslave includes a script to
@@ -13,10 +13,11 @@ def update_search_path(m):
return m.group(1) + ', '.join(schemas) + ';'
def update_schema(m):
- return config.schema.name(m.group(1)) + '.'
+ return m.group(1) + config.schema.name(m.group(2)) + m.group(3)
for line in sys.stdin:
line = re.sub(r'(SET search_path = )(.+?);', update_search_path, line)
- line = re.sub(r'\b(\w+)\.', update_schema, line)
+ line = re.sub(r'(\b)(\w+)(\.)', update_schema, line)
+ line = re.sub(r'( SCHEMA )(\w+)(;)', update_schema, line)
sys.stdout.write(line)

0 comments on commit 888b486

Please sign in to comment.