New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve database design for show/performance start & end dates #386

philosophicles opened this Issue Feb 8, 2018 · 2 comments


None yet
4 participants
Copy link

philosophicles commented Feb 8, 2018

Issue added based on @hoyes comments on #385.

Usage of Show/Performance start/end dates is a bit confused at the moment. The columns start_at and end_at were added to Show in v2 but that was possibly a slightly silly optimisation in hindsight - it's just a cache of min(performances.start_date) and max(performances.end_date).

updateTimes in is where those times currently get updated.

The optimal fix would probably be to:

  • Remove the start_at and end_at Doctrine fields from Show. These fields were added in v2 so no backwards compatibility issues.
  • Refactor all queries in ShowRepository (and maybe elsewhere too) to query the performances directly.
  • Check where else in the codebase calls Show::getStartAt or Show::setStartAt. Either refactor those to query performances directly too, or maybe easier to just retain Show::getStartAt and copy the logic from ShowListener::updateTimes so it's calculated on demand instead of caching it. (ditto *EndAt). Premature optimisation and all that.
  • Remove ShowListener::updateTimes

@philosophicles philosophicles added this to the Future milestone Feb 8, 2018

GKFX added a commit that referenced this issue Sep 17, 2018


This comment has been minimized.

Copy link

GKFX commented Nov 30, 2018

From @hoyes on #530:
Getting a bit pernickety, but I don't really like how start/end times are formatted at the moment:

"date": "2018-11-30T00:00:00+00:00",
"start_time": "1970-01-01T12:30:00+00:00",
"end_time": "1970-01-01T16:30:00+00:00",

Wondering about changing it everywhere to something like

"start_at": "2018-11-30T12:30:00+00:00",
"end_at": "2018-11-30T16:30:00+00:00",
"repeat_until": "2018-12-04T12:30:00",

, with "end_at" and "repeat_until" being optional. Means that for performances (which don't have an end time), "end_at" will be absent, and for auditions (which don't repeat) "repeat_until" will be absent. It also mirrors how iCal / RFC 5545 works.

@hoyes hoyes self-assigned this Nov 30, 2018


This comment has been minimized.

Copy link

CHTJonas commented Jan 10, 2019

I believe this has been resolved in #543, so closing.

@CHTJonas CHTJonas closed this Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment