Skip to content

Defining timestamps: true in the new Sequelize() class doesn't work. #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chanlito opened this issue Jul 25, 2017 · 1 comment
Closed
Assignees
Labels

Comments

@chanlito
Copy link
Contributor

private setupDatabase(): void {
    this.db = this.app.context.db = new Sequelize({
      ...this.config.db,
      modelPaths: [ this.config.app.modelsDir ],
      define: {
        timestamps: true,
        underscored: true,
        freezeTableName: true,
        charset: 'utf8',
        collate: 'utf8_general_ci',
        createdAt: 'created_date',
        updatedAt: 'updated_date',
        deletedAt: 'deleted_date'
      },
      logging: this.config.db.sync.logging,
      sync: this.config.db.sync,
      validateOnly: false
    });
  }

When i call sync() it doesn't create with created_date, updated_date....

@RobinBuschmann
Copy link
Member

thanks for raising this... I already have an idea, why this isn't working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants