Skip to content

Migrate Exposed from Joda-Time to kotlinx-datetime (#81)#81

Merged
pambrose merged 3 commits intomasterfrom
migrate-jodatime-to-kotlinx-datetime
Apr 12, 2026
Merged

Migrate Exposed from Joda-Time to kotlinx-datetime (#81)#81
pambrose merged 3 commits intomasterfrom
migrate-jodatime-to-kotlinx-datetime

Conversation

@pambrose
Copy link
Copy Markdown
Contributor

Summary

  • Replace exposed-jodatime with exposed-kotlin-datetime, migrating all 18 datetime columns from Joda DateTime to kotlin.time.Instant via Exposed's timestamp() column type
  • Add InstantExpr.kt with nowInstant() and instantExpr() helpers to bridge kotlin.time.Instant / kotlinx.datetime.Clock and replace the Joda-dependent dateTimeExpr() from common-exposed-utils
  • Update 6 source files and 3 test files to use nowInstant() instead of DateTime.now(UTC)
  • Add DateTimeMigrationTest with 8 tests covering timestamp round-trips, upsert behavior, instantExpr SQL expressions, and Instant arithmetic
  • No SQL schema migration needed — both column types map to PostgreSQL TIMESTAMPTZ

Test plan

  • ./gradlew build -xtest compiles with zero errors and zero warnings
  • ./gradlew check — all existing and new tests pass
  • grep -r "org.joda.time" readingbat-core/src/ returns zero results
  • grep -r "jodatime" readingbat-core/src/ returns zero results
  • ./gradlew lintKotlinMain lintKotlinTest passes

🤖 Generated with Claude Code

pambrose and others added 3 commits April 12, 2026 14:03
Replace exposed-jodatime with exposed-kotlin-datetime module, migrating
all datetime columns from Joda DateTime to kotlin.time.Instant via
Exposed's timestamp() column type. No SQL schema migration needed since
both map to PostgreSQL TIMESTAMPTZ.

- Replace exposed-jodatime with exposed-kotlin-datetime in version catalog
- Change all 18 datetime() columns to timestamp() in PostgresTables.kt
- Add InstantExpr.kt with nowInstant() and instantExpr() helpers to bridge
  the kotlin.time.Instant / kotlinx.datetime.Clock gap and replace the
  Joda-dependent dateTimeExpr() from common-exposed-utils
- Update all source files (6) and test files (3) to use nowInstant()
- Add DateTimeMigrationTest with 8 tests covering timestamp round-trips,
  upsert behavior, instantExpr SQL expressions, and Instant arithmetic

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
apply true is the default for Gradle plugin declarations, so the
explicit annotation is unnecessary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pambrose pambrose merged commit 115f324 into master Apr 12, 2026
1 of 3 checks passed
@pambrose pambrose deleted the migrate-jodatime-to-kotlinx-datetime branch April 12, 2026 21:17
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.

1 participant