fix: after reinitialization, hooks are lost

This commit is contained in:
chenos 2020-12-09 17:14:42 +08:00
parent f24d948f83
commit 96510cc929

View File

@ -220,7 +220,7 @@ export class Table {
updatedAt: Utils.underscoredIf('updatedAt', underscored),
indexes: Array.from(this.indexes.values()),
// freezeTableName: true,
hooks: _.get(this.Model.options, 'hooks') || {},
hooks: _.get(this.getModel(), 'options.hooks') || {},
...this.modelOptions,
};
}