A
A
alestro2020-06-04 17:22:18
MySQL
alestro, 2020-06-04 17:22:18

What is the best way to design a database for a post preview?

Actually, the whole point of the question is in the title, but I’ll clarify a little: let’s say there is a table posts (title, content) at the moment I want to implement the ability to display a preview (image or video) on the main page, in the future it may be necessary to expand the supported preview types, for example, display a slider or image gallery. So, how best to design a database for a similar task while maintaining the integrity of the tables.
So far, I'm thinking of adding the preview_image_id and preview_video_id columns to posts and, if necessary, adding more columns of the preview_gallery_id type.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2020-06-04
Tag

a link to the preview table, where the record will have a preview type and a link to the resource

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question