Many events in our DB have a starts_at that is greater than ends_at.
SELECT*FROMeventsWHEREends_at<starts_atYou can see related event counts (events that have the shift) like this:
SELECTshift_events.shift_id,count(*)FROMeventsJOINshift_eventsONshift_events.id=events.eventable_idWHEREevents.ends_at<events.starts_atGROUPBYshift_events.shift_id;This is causing the one-time shift page to crash. It's unclear right now how these are being entered.
Many events in our DB have a `starts_at` that is greater than `ends_at`.
```sql
SELECT * FROM events WHERE ends_at < starts_at
```
You can see related event counts (events that have the shift) like this:
```sql
SELECT shift_events.shift_id, count(*)
FROM events
JOIN shift_events ON shift_events.id = events.eventable_id
WHERE events.ends_at < events.starts_at
GROUP BY shift_events.shift_id;
```
This is causing the one-time shift page to crash. It's unclear right now how these are being entered.