Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 30.0.0
==============

- Schema change 30.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Changelog detail could be enriched
Consider adding a brief note about requiring a user-level search_path change (e.g., ALTER USER foo SET search_path TO musicbrainz, public) to help DB admins avoid the function-not-found error.

🤖 Prompt for AI Agents
In CHANGELOG.rst at line 4, the changelog entry "Schema change 30." is too brief
and lacks important context. Enhance this entry by adding a note about the
necessity for a user-level search_path change, such as "ALTER USER foo SET
search_path TO musicbrainz, public", to inform database administrators about
this requirement and help prevent function-not-found errors.


Version 29.1.0
==============

Expand Down
20 changes: 18 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MusicBrainz Database Mirror
:target: https://badge.fury.io/py/mbslave

This repository now contains a collection of scripts for managing a
replica of the MusicBrainz database.
replica of the MusicBrainz database.

The main motivation for these scripts is to be able to customize
your database. If you don't need such customizations, it might be
Expand Down Expand Up @@ -36,7 +36,7 @@ There are two ways to configure the application.

export MBSLAVE_CONFIG=/usr/local/etc/mbslave.conf

2. Alternativelly, you can use using environment variables::
2. Alternatively, you can use environment variables::

export MBSLAVE_DB_HOST=127.0.0.1
export MBSLAVE_DB_PORT=5432
Expand All @@ -46,6 +46,14 @@ There are two ways to configure the application.
export MBSLAVE_DB_ADMIN_USER=postgres
export MBSLAVE_DB_ADMIN_PASSWORD=XXX

Be aware, that configuring a different value for `db.user` or `schemas.musicbrainz` might require to configure a
custom `search_path` for the user (or database): By default, postgres sets the search_path to `"$user", public`.
If both is `musicbrainz` everything works, if they differ, you might run into errors when running `mbslave sync` as
triggers can't lookup functions properly. One way to solve this is to set the search path for your custom user to the
schema configured for musicbrainz::

ALTER USER myuser SET search_path TO musicbrainz, public;

Database Setup
==============

Expand Down Expand Up @@ -82,6 +90,14 @@ When the MusicBrainz database schema changes, the replication will stop working.
This is usually announced on the `MusicBrainz blog <http://blog.musicbrainz.org/>`__.
When it happens, you need to upgrade the database.

Release 2025-05-19 (30)
~~~~~~~~~~~~~~~~~~~~~~~

Run the upgrade scripts::

mbslave psql -f updates/schema-change/30.all.sql
echo 'UPDATE replication_control SET current_schema_sequence = 30;' | mbslave psql

Release 2024-05-13 (29)
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion mbslave/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.

__version__ = "29.1.0"
__version__ = "30.0.0"
5 changes: 5 additions & 0 deletions mbslave/sql/CreateFKConstraints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,11 @@ ALTER TABLE medium_format
FOREIGN KEY (parent)
REFERENCES medium_format(id);

ALTER TABLE medium_gid_redirect
ADD CONSTRAINT medium_gid_redirect_fk_new_id
FOREIGN KEY (new_id)
REFERENCES medium(id);

ALTER TABLE medium_index
ADD CONSTRAINT medium_index_fk_medium
FOREIGN KEY (medium)
Expand Down
Loading