Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move registry plugin to core #1996

merged 7 commits into from
Jul 28, 2019

Move registry plugin to core #1996

merged 7 commits into from
Jul 28, 2019


Copy link

@ricardograca ricardograca commented Jul 27, 2019


Move the registry plugin to core Bookshelf.


This is a useful plugin and is the best way to ensure there are no circular dependencies issues when models are located in different files.

Fixes #1557.

Proposed solution

Functionality is moved to the bookshelf.js file. Note that registered models and collections are now stored in the bookshelf.registry.models and bookshelf.registry.collections respectively. This means the change is not backwards compatible but it's not expected that users were accessing bookshelf._models and bookshelf._collections directly anyway.

A lot of the code was modernized.

- This replaces the previous bookshelf.Model.extend() method usage since 
it's preferable as it avoids circular dependencies.
@ricardograca ricardograca merged commit 189b828 into master Jul 28, 2019
@ricardograca ricardograca deleted the rg-core-registry branch July 28, 2019 15:07
@ricardograca ricardograca mentioned this pull request Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

Registry: multiple databases with same schema
1 participant