A
A
Alexander2019-11-24 17:09:42
MySQL
Alexander, 2019-11-24 17:09:42

How to store in the database Different titles of the same movie, type of movie?

There is a movie for example. There are several names.
Russian, English, Original can be (For example, in Chinese or Indian). It is not known in advance how many of these names, maybe one is all, or maybe 5.
I think how is it better to organize this in the database?
I think to store the original in a separate field. And others I don't know. Maybe in json, maybe just in text.
There are also statuses. Completed, Announcement, etc. I'm thinking of creating an enum type. I don't know right or wrong.
For example enum ('PUBLISHED', 'DRAFT', 'PENDING') default 'DRAFT' not null

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2019-11-24
@dimoff66

movies: id, original_language, year
movie_names: movie_id, language, name
movie_statuses: movie_id, status(enum), updated
Even if the statuses are expanded, the enum can always be expanded, there is no problem, it is better to store the statuses in a separate table with the change history

F
FanatPHP, 2019-11-24
@FanatPHP

Is it just translations? If yes, then a table with 4 fields: from movie, language id, title, originality flag.
I would store the status in a separate table. The enum is good for cases where the set of options is known in advance. Here, for sure, values ​​\u200b\u200bwill be added and it is better to do this through updating the data, and not the structure

K
Konstantin Tsvetkov, 2019-11-24
@tsklab

Release info .
Separate "Release Information" table: movie, date, country, language, title.
And show depending on the user's language.5dda9948ea18c036522200.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question