mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:36:42 +00:00
fix: column ui_schema_id does not exist
This commit is contained in:
parent
7313307210
commit
907eb72efc
@ -4,16 +4,21 @@ import { FieldModel } from '../models';
|
|||||||
|
|
||||||
export default class extends Migration {
|
export default class extends Migration {
|
||||||
async up() {
|
async up() {
|
||||||
|
|
||||||
const transaction = await this.db.sequelize.transaction();
|
const transaction = await this.db.sequelize.transaction();
|
||||||
|
|
||||||
const migrateFieldsSchema = async (collection: Collection) => {
|
const migrateFieldsSchema = async (collection: Collection) => {
|
||||||
this.app.log.info(`Start to migrate ${collection.name} collection's ui schema`);
|
this.app.log.info(`Start to migrate ${collection.name} collection's ui schema`);
|
||||||
|
|
||||||
collection.setField('uiSchemaUid', {
|
const field = collection.setField('uiSchemaUid', {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const exists = await field.existsInDb({ transaction });
|
||||||
|
|
||||||
|
if (!exists) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const fieldRecords: Array<FieldModel> = await collection.repository.find({
|
const fieldRecords: Array<FieldModel> = await collection.repository.find({
|
||||||
transaction,
|
transaction,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user