Skip to content

fix(entity): set the default value of UpdateDateColumn to CURRENT_TIMESTAMP#2913

Merged
M0NsTeRRR merged 1 commit intodevelopfrom
fix/typeorm-updatedatcolumn
Apr 20, 2026
Merged

fix(entity): set the default value of UpdateDateColumn to CURRENT_TIMESTAMP#2913
M0NsTeRRR merged 1 commit intodevelopfrom
fix/typeorm-updatedatcolumn

Conversation

@gauthier-th
Copy link
Copy Markdown
Member

@gauthier-th gauthier-th commented Apr 20, 2026

Description

Fix future TypeORM migrations by explicitly setting the default value for @UpdateDateColumn to CURRENT_TIMESTAMP across all entities. This prevents migrations from incorrectly generating with datetime('now').

How Has This Been Tested?

Try to generate a TypeORM migration before/after with:
pnpm migration:generate test

The migration after this change doesn't contain all the changes on the updatedAt columns.

Screenshots / Logs (if applicable)

N/A

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • Chores
    • Updated database timestamp field configurations across core entities to include explicit default values, ensuring consistent initialization behavior when records are created and modified.

@gauthier-th gauthier-th requested a review from a team as a code owner April 20, 2026 14:39
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7593715-6493-4525-861a-0ce505379268

📥 Commits

Reviewing files that changed from the base of the PR and between 1d2aa76 and 83c3b50.

📒 Files selected for processing (10)
  • server/entity/DiscoverSlider.ts
  • server/entity/Issue.ts
  • server/entity/IssueComment.ts
  • server/entity/Media.ts
  • server/entity/MediaRequest.ts
  • server/entity/OverrideRule.ts
  • server/entity/Season.ts
  • server/entity/SeasonRequest.ts
  • server/entity/User.ts
  • server/entity/Watchlist.ts

📝 Walkthrough

Walkthrough

This PR adds a default: () => 'CURRENT_TIMESTAMP' option to the @UpdateDateColumn decorators across 10 entity files in the server/entity/ directory. Each updatedAt field now explicitly sets a database-level default timestamp, alongside its existing datetime type specification.

Changes

Cohort / File(s) Summary
Entity Column Defaults
server/entity/DiscoverSlider.ts, server/entity/Issue.ts, server/entity/IssueComment.ts, server/entity/Media.ts, server/entity/MediaRequest.ts, server/entity/OverrideRule.ts, server/entity/Season.ts, server/entity/SeasonRequest.ts, server/entity/User.ts, server/entity/Watchlist.ts
Added default: () => 'CURRENT_TIMESTAMP' to @UpdateDateColumn decorators for updatedAt fields across all entity files, providing explicit database-level default timestamp initialization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • 0xSysR3ll

Poem

🐰 Whiskers twitching with delight,
Timestamps now default just right,
CURRENT_TIMESTAMP flows so true,
Ten entities, all shiny new! ⏰✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding default CURRENT_TIMESTAMP values to UpdateDateColumn decorators across all entity files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seerr-automation-bot seerr-automation-bot added this to the v3.3.0 milestone Apr 20, 2026
@M0NsTeRRR M0NsTeRRR merged commit 86e780e into develop Apr 20, 2026
16 checks passed
@M0NsTeRRR M0NsTeRRR deleted the fix/typeorm-updatedatcolumn branch April 20, 2026 15:13
VozDeOuro pushed a commit to VozDeOuro/seerr that referenced this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants