Merge branch 'refactor/association-field' of github.com:nocobase/nocobase into refactor/association-field

This commit is contained in:
katherinehhh 2023-05-10 19:25:03 +08:00
commit 8093a998b5
2 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,12 @@ import { FieldModel } from '../models';
export default class extends Migration {
async up() {
const result = await this.app.version.satisfies('<0.9.2-alpha.2');
if (!result) {
return;
}
const transaction = await this.db.sequelize.transaction();
const migrateFieldsSchema = async (collection: Collection) => {

View File

@ -41,6 +41,12 @@ export default class extends Migration {
} else {
continue;
}
if (schema['x-component-props']?.mode === 'tags') {
schema['x-component-props']['enableLink'] = true;
} else if (schema['x-component-props']?.mode === 'links') {
schema['x-component-props']['enableLink'] = true;
}
schema['x-component-props']['mode'] = 'Picker';
item.set('schema', schema);
await item.save({ transaction });
}