Skip to content
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

timestamp: false is ignored when doing the migration #728

Open
juanpablo64 opened this issue Oct 12, 2023 · 0 comments
Open

timestamp: false is ignored when doing the migration #728

juanpablo64 opened this issue Oct 12, 2023 · 0 comments

Comments

@juanpablo64
Copy link

juanpablo64 commented Oct 12, 2023

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",

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

No branches or pull requests

1 participant