Skip to content

Conversation

@chamika
Copy link
Owner

@chamika chamika commented Jan 6, 2026

The value is dynamically calculating form current time

The value is dynamically calculating form current time
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 6, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tabletennis 14283ab Commit Preview URL

Branch Preview URL
Jan 06 2026, 12:13 AM

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 6, 2026

Deploying tabletennis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 14283ab
Status: ✅  Deploy successful!
Preview URL: https://306b7915.tabletennis.pages.dev
Branch Preview URL: https://remove-is-past-persistence.tabletennis.pages.dev

View logs

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the is_past field from a stored database column to a dynamically computed field in the API layer. The field is now calculated at runtime by comparing the fixture's match date with the current date, eliminating the need to update this value in the database.

Key Changes:

  • Introduced FixtureRow type for database records and extended it with a computed is_past field in the Fixture type for API responses
  • Updated all database operations to remove is_past column references
  • Added dynamic computation of is_past in API endpoints that return fixture data

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
worker/src/types.ts Added FixtureRow interface for database model and extended it with Fixture interface that includes computed is_past field
worker/src/index.ts Added isPastDate import and dynamic computation of is_past field in two API endpoints that return fixtures
worker/src/index.test.ts Updated test mocks to use FixtureRow type and removed is_past field from fixture test data
worker/src/database.ts Removed is_past from all SQL statements, changed return types from Fixture to FixtureRow, and removed unused isPastDate import
worker/src/database.integration.test.ts Updated integration tests to remove assertions on is_past storage and adjusted parameter count expectations
worker/schema.sql Removed is_past column definition from fixtures table schema
worker/migrations/README.md Added comprehensive migration documentation with commands for applying and verifying the migration across environments
worker/migrations/0001_remove_is_past.sql Created migration script to drop the is_past column from the fixtures table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chamika chamika merged commit 4cf74d6 into main Jan 6, 2026
4 checks passed
@chamika chamika deleted the remove-is_past-persistence branch January 6, 2026 00:21
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.

2 participants