Answer the question
In order to leave comments, you need to log in
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
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
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
Release info .
Separate "Release Information" table: movie, date, country, language, title.
And show depending on the user's language.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question