Subsequent migrations fail after running db:migrate:schema:timestamps:add command
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, mysql
Research direction
Start with the db:migrate:schema:timestamps:add command and the migration setup that creates or updates the SequelizeMeta table. Reproduce on MySQL 5.7 with Sequelize CLI and inspect why createdAt lacks a default value; done means subsequent migrations run successfully without the Field 'createdAt' error.
Written by the indexing model from the issue text.
Description
Issue Creation Checklist
- I understand that my issue will be automatically closed if I don't fill in the requested information
- I have read the contribution guidelines
Bug Description
Reproducible Example
Start up a new sequelize project;
Run npx sequelize-cli db:migrate:schema:timestamps:add command
Subsequent migrations will fail to run returning the following error:
ERROR: Field 'createdAt' doesn't have a default value
From my investigation, what's happening is that createdAt field in SequelizeMeta table doesn't have a default value - and that's where that error is thrown from.
What do you expect to happen?
For the migration to run successfully.
What is actually happening?
Environment
- Sequelize version: ^6.37.0
- Node.js version: v18.19.0
- If TypeScript related: TypeScript version: N\A
- Database & Version: MySQL v5.7.39
- Connector library & Version:
Would you be willing to resolve this issue by submitting a Pull Request?
- Yes, I have the time and I know how to start.
- Yes, I have the time but I will need guidance.
- No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
- No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
- Dominant language
- JavaScript
- Stars
- 2.6k
- Forks
- 524
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sequelize/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 84/100