mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-03 20:58:01 +08:00
fix: collection manager with sqlite
This commit is contained in:
parent
be1192531c
commit
1d11a3e793
@ -33,12 +33,16 @@ export default class CollectionManagerPlugin extends Plugin {
|
|||||||
this.app.db.on('fields.afterCreate', afterCreateForReverseField(this.app.db));
|
this.app.db.on('fields.afterCreate', afterCreateForReverseField(this.app.db));
|
||||||
this.app.db.on('collections.afterCreate', async (model, options) => {
|
this.app.db.on('collections.afterCreate', async (model, options) => {
|
||||||
if (options.context) {
|
if (options.context) {
|
||||||
await model.migrate();
|
process.nextTick(async () => {
|
||||||
|
await model.migrate();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.app.db.on('fields.afterCreate', async (model, options) => {
|
this.app.db.on('fields.afterCreate', async (model, options) => {
|
||||||
if (options.context) {
|
if (options.context) {
|
||||||
await model.migrate();
|
process.nextTick(async () => {
|
||||||
|
await model.migrate();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user