question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when running knex migration with MySQL

See original GitHub issue

I’m getting the following error when attempting to run the wiki configured with MySQL:

Knex:warning - migrations failed with error: create table `articles` (`id` int unsigned not null auto_increment primary key, `title` varchar(255), `body` text, `created_at` timestamp not null default
(datetime(CURRENT_TIMESTAMP,'localtime')), `updated_at` timestamp not null default (datetime(CURRENT_TIMESTAMP,'localtime'))) - ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(datetime(CURRENT_TIMESTAMP,'localtime')), `updated_at` timestamp not null defau' at line 1
Unhandled rejection Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(datetime(CURRENT_TIME
STAMP,'localtime')), `updated_at` timestamp not null defau' at line 1

Any thoughts? Could it be the function in misc.js?

Great project - I’m hoping to use this for our new company dev wiki.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
IshwarKansecommented, Jan 16, 2017

@nshntarora Thanks, it’s working now.

0reactions
damianestebancommented, Jan 17, 2017

Yes, working well. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fatal error when running a migration with knex CLI ... - GitHub
I believe this line is a bug. Reduced test code, for example in https://npm.runkit.com/knex or if it needs real database connection to mysql...
Read more >
knex & MYSQL js error ER_CANNOT_ADD_FOREIGN
I figured out it was how the files were made. Knex builds each table in the order you did this command js knex...
Read more >
Migrations | Knex.js
There must be only one row in this table, or an error will be thrown when running migrations: "Migration table is already locked"....
Read more >
Database Migrations with Knex - Perk
We never want to edit a migration file after it has been run because when we run knex migrate:latest knex will not make...
Read more >
Knex.js Tutorial For Beginners - Shahed Nasser
Before you create a migration, make sure you're still in the db directory. Then, inside that directory run: knex migrate:make create_users_table.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found