From 96510cc9295cb34d53a5c60c7aa69024fca4b197 Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 9 Dec 2020 17:14:42 +0800 Subject: [PATCH] fix: after reinitialization, hooks are lost --- packages/database/src/table.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/database/src/table.ts b/packages/database/src/table.ts index 92167e7364..aaf42604bd 100644 --- a/packages/database/src/table.ts +++ b/packages/database/src/table.ts @@ -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, }; }