Error when running knex migration with MySQL
See original GitHub issueI’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:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nshntarora Thanks, it’s working now.
Yes, working well. Thank you.