I found out that if you want the Google data markup to recognize your data, you should follow these guidelines:
https://schema.org/openingHours
http://schema.org/OpeningHoursSpecification Contains "valid dates", which is very useful for some companies.
https://schema.org/docs/search_results.html#q=hours
You should have everything in order without a primary key, if you do not allow companies to share the same hours with the connection table - it is interesting that in the end you will have a finite number of combinations; I'm not sure how much it will be: p
In one of my projects, I used columns:
[uInt] business_id, [uTinyInt] day, [char (11)] timeRange
If you want to support the OpenHoursSpecification function, you need to add validFrom and validThrough.
The time range is formatted as follows: hh: mm-hh: mm
Here is a function that analyzes it, you can also change this function to analyze only one open / closed if you store them as separate columns in the database.
From my experience, I would recommend that you allow several times during the day, to give the opportunity to find out if they are closed on the same day or open 24 hours or 24/7. I had my opinion that if there was a day in the database, then that day the business was closed.
/** * parseTimeRange * parses a time range in the form of * '08:55-22:00' * @param $timeRange 'hh:mm-hh:mm' '08:55-22:00' * @return mixed ['hourStart'=>, 'minuteStart'=>, 'hourEnd'=>, 'minuteEnd'=>] */ function parseTimeRange($timeRange) { // no validating just parsing preg_match('/(?P<hourStart>\d{1,2}):(?P<minuteStart>\d{2})-(?P<hourEnd>\d{1,2}):(?P<minuteEnd>\d{2})/', $timeRange, $matches); return $matches; }