mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-04 21:28:34 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
99070be46d
@ -7,14 +7,14 @@
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import { Model } from './model';
|
||||
import { isPlainObject } from '@nocobase/utils';
|
||||
import { Model as SequelizeModel } from 'sequelize';
|
||||
import { Collection } from './collection';
|
||||
import Database from './database';
|
||||
import { InheritedSyncRunner } from './inherited-sync-runner';
|
||||
import { InheritedCollection } from './inherited-collection';
|
||||
import { Model as SequelizeModel } from 'sequelize';
|
||||
import { ZeroColumnTableError } from './errors/zero-column-table-error';
|
||||
import { isPlainObject } from '@nocobase/utils';
|
||||
import { InheritedCollection } from './inherited-collection';
|
||||
import { InheritedSyncRunner } from './inherited-sync-runner';
|
||||
import { Model } from './model';
|
||||
|
||||
export class SyncRunner {
|
||||
private readonly collection: Collection;
|
||||
@ -74,14 +74,17 @@ export class SyncRunner {
|
||||
throw e;
|
||||
}
|
||||
|
||||
let beforeColumns;
|
||||
|
||||
try {
|
||||
const beforeColumns = await this.queryInterface.describeTable(this.tableName, options);
|
||||
beforeColumns = await this.queryInterface.describeTable(this.tableName, options);
|
||||
} catch (error) {
|
||||
// continue
|
||||
}
|
||||
|
||||
if (beforeColumns) {
|
||||
await this.handlePrimaryKeyBeforeSync(beforeColumns, options);
|
||||
await this.handleUniqueFieldBeforeSync(beforeColumns, options);
|
||||
} catch (e) {
|
||||
if (!e.message.includes('No description found')) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
const syncResult = await this.performSync(options);
|
||||
|
Loading…
Reference in New Issue
Block a user