mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:38:13 +00:00
fix: transaction cannot be rolled back because it has been finished
This commit is contained in:
parent
89284bb175
commit
aece9015aa
@ -1,6 +1,6 @@
|
||||
import { Collection } from '@nocobase/database';
|
||||
import { Migration } from '@nocobase/server';
|
||||
import { FieldModel } from '../models';
|
||||
import { Collection } from '@nocobase/database';
|
||||
|
||||
export default class extends Migration {
|
||||
async up() {
|
||||
@ -62,7 +62,6 @@ export default class extends Migration {
|
||||
});
|
||||
}
|
||||
|
||||
await transaction.commit();
|
||||
collection.removeField('uiSchemaUid');
|
||||
this.app.log.info('Migrate uiSchema to options field done');
|
||||
};
|
||||
@ -73,6 +72,8 @@ export default class extends Migration {
|
||||
if (this.db.getCollection('fieldsHistory')) {
|
||||
await migrateFieldsSchema(this.db.getCollection('fieldsHistory'));
|
||||
}
|
||||
|
||||
await transaction.commit();
|
||||
} catch (error) {
|
||||
await transaction.rollback();
|
||||
this.app.log.error(error);
|
||||
|
Loading…
Reference in New Issue
Block a user