title: Sequelize Typescript @BeforeUpdate Hook not working
body: <p>I am using Sequelize Typescript module for my serverless lambda function. The user model has two hooks, beforecreate and beforeupdate. The user model looks like this:</p>
  
  <pre><code>import { Table, Column, ForeignKey, BeforeCreate, BeforeUpdate, BelongsTo } from 'sequelize-typescript';
  import { Role } from './role';
  import bcrypt from 'bcrypt-nodejs';
  import { BaseModel } from './base';
  const saltRounds = 10;
  
  @Table({
      tableName: 'users'
  })
  
  export class User extends BaseModel {
  
      @Column
      firstName!: string;
  
      @Column
      lastName!: string;
  
      @Column
      password!: string;
  
      @Column
      email!: string;
  
      @Column
      isActive!: boolean;
  
      @Column
      companyId: string
  
      @ForeignKey(() =&gt; Role)
      @Column
      roleId!: string;
  
      @BelongsTo(() =&gt; Role)
      role!: Role;
  
      @BeforeCreate
      @BeforeUpdate
      static hashPassword(user: User) {
          if (user.password) {            
              var salt = bcrypt.genSaltSync(saltRounds);
              user.password = bcrypt.hashSync(user.password, salt);
          }
      }
  }
  </code></pre>
  
  <p>Now when I create a new user the model hashes the password and saves the hashed password in the table, but when I try to update the password of a user the password is saved in plain text. So I am guessing the @BeforeCreate works and the @BeforeUpdate hook does not. </p>
  
  <p>I even tried separating the two hooks and giving them their own functions:</p>
  
  <pre><code>@BeforeCreate
  static hashPasswordBeforeCreate(user: User) {
      if (user.password) {            
          var salt = bcrypt.genSaltSync(saltRounds);
          user.password = bcrypt.hashSync(user.password, salt);
      }
  }
  
  
  @BeforeUpdate
  static hashPasswordBeforeUpdate(user: User) {
      if (user.password) {            
          var salt = bcrypt.genSaltSync(saltRounds);
          user.password = bcrypt.hashSync(user.password, salt);
      }
  }
  </code></pre>
  
  <p>But the before update still does not work. What am I doing wrong?</p>