Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
knex migration - 'ER_INVALID_DEFAULT: Invalid default value for 'timestamp'

I have a knex chema migration to create a table, with the line -

exports.up = async function(knex) {
return knex.schema.createTable("newTable", table => {
table.timestamp("timestamp").notNullable();
})
}

I am getting an error ER_INVALID_DEFAULT: Invalid default value for 'timestamp'

I've tried to give a default of null and remove the notNullable() or a default of CURRENT_TIMESTAMP but nothing seems to work (maybe I have a wrong syntax?)

I'd appreciate any help!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you have access to my.ini (mysql conf file) remove the NO_ZERO_DATE from sql-mode and restart the server.

You can check it with SHOW VARIABLES LIKE 'sql_mode'

For the complete answer, follow the link

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda