Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

distantplanet's avatar

Do i need one DB table/Model or should they be seperate?

I'm working on a website that consists of three main parts: An internet radio station, an (irl) events listing and an archive of recording from both the radio broadcasts and events.

The Radio and Event components overlap in a lot of ways because some of the events are also broadcasted on the radio (but not all events are broadcasted and not all broadcasts are events)

Any of them have the option to be archived with audio recordings from the event or broadcast.

Radio broadcasts cannot overlaps as this is how DJs reserve time slot and see what times are available but Events can be at the same time as other events since they're often at different locations.

What i'm stuck on is whether it would be best to have one post type for both (with booleans such as isBroadcast and isEvent and all necessary fields for both types) or should i have separate DB tables and models for each.

Such as

Broadcasts: Title, date/time, description, image, audio_streaming_url, video_streming_url

Events: Title, date/time, description, image, venue, price

or just

Post: Title, date/time, description, image, isEvent, isBroadcast, streaming_url, video_streaming_url, venue, price

Having Broadcasts and Events the same as the Database table/Model seems easiest for the instances when the post is both a Broadcast and Event and also easier for Archiving because i could simply create archive post with post_id as a field.

Such as

Archive: Post_id, soundcloud_link, youtube_url, additional_text

But having a single post type would make it confusing in regards to reserving time slots for the radio broadcasts since the Events can overlap but the radio broadcasts cannot.

Or is this pointless to think too much about as i'm sure either way would work?

0 likes
1 reply
lostdreamer_nl's avatar

I would separate them both as they have different logic (Radio broadcasts cannot overlap, Events on the other hand can)

You might get more separate logic in the future, so instead of having if / else clauses throughout the event model, I'd go for separation asap.

1 like

Please or to participate in this conversation.