Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda