Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!