Skip to content

timestamp: false is ignored when doing the migration #728

@juanpablo64

Description

@juanpablo64

Hi! I have this model structure:
const { Model } = require('sequelize'); module.exports = (sequelize, DataTypes) => { class EncuestaRealizada extends Model { static associate({Usuario, Encuesta}) { this.belongsTo(Usuario, {foreignKey: 'userID', as: 'usuario' }) this.belongsTo(Encuesta, {foreignKey: 'encuestaID', as: 'encuesta' }) // define association here } }; EncuestaRealizada.init({ id: { allowNull: false, autoIncrement: true, primaryKey: true, type: DataTypes.INTEGER }, userID: { allowNull: false, primaryKey: true, type: DataTypes.INTEGER }, encuestaID: { allowNull: false, primaryKey: true, type: DataTypes.INTEGER }, fecha_realizada:{ allowNull: false, type: DataTypes.DATE, } },{ sequelize, //define table name timestamps: false, createdAt:false, updatedAt:false, tableName: 'encuestaRealizada', modelName: 'EncuestaRealizada', }); return EncuestaRealizada; };
it comes from a belongstomany relationship with Usuario and Grupo. When I execute the migration, the resulting table has the columns createdAt and updatedAt, but I am using timestamp: false. The column fecha_realizada is ignored too. What could be the reason?

Here's my package.json

"sequelize": "^6.33.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions