fix: roles collection options in share app

This commit is contained in:
Chareice 2024-12-12 16:33:07 +08:00
parent de323cf6f8
commit e72bb89909
No known key found for this signature in database

View File

@ -39,6 +39,10 @@ class SubAppPlugin extends Plugin {
subApp.db.on('beforeDefineCollection', (options) => {
const name = options.name;
if (name === 'roles') {
options.loadedFromCollectionManager = true;
}
// 共享的Collection指向主应用的 系统schema
if (sharedCollections.includes(name)) {
options.schema = mainApp.db.options.schema || 'public';