chore(sequelize-cli): sync define.timestamps with db.config.js#178
Merged
CryptoJones merged 1 commit intoMay 19, 2026
Merged
Conversation
…, not false PR #148 flipped `db.config.js`'s global `define.timestamps` default from `false` to `true` so every domain model inherits Sequelize's auto-populated `createdAt` / `updatedAt` without an explicit override. `sequelize-cli.config.js` — the config file the migrate CLI reads — was missed and still declared `timestamps: false`. In practice this doesn't break anything today: migrations use `queryInterface` directly, not the model layer, so the `define` default never gets consulted from the CLI path. But two adjacent files declaring opposite defaults is a smell that would burn a future contributor who tried to add model-based logic to a migration. Flip the cli config's value to `true` to match the runtime, and pin both `define.timestamps` and `define.schema` agreement in a new `tests/unit/sequelize-cli-config.test.js` so a future drift fails loudly instead of silently. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #177.
Summary
PR #148 flipped
db.config.js'sdefine.timestampsfromfalsetotrueso every domain model inherits Sequelize's auto-populatedcreatedAt/updatedAt.sequelize-cli.config.jswas missed andstill declared
timestamps: false.Not breaking today (migrations don't use the model layer) but a
latent footgun if anyone adds model-based code to a migration later.
This PR brings the two configs into sync and adds a unit test pinning
both
define.timestampsanddefine.schemaagreement so a futuredrift fails CI instead of going silent.
Test plan
npm run lintcleannpm test— 622 → 628 (+6 cross-config invariants)cliConfig.<env>.define.timestamps === dbConfig.sequelize.options.define.timestampsdefine.schemaProudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/