You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the movies have a chronology property with a number to order them chronologically. I would also like this property on the tv shows so all the projects can be ordered by that one property. I would love to hear if this is possible in some way.
The text was updated successfully, but these errors were encountered:
Hi, @deBasMan21. It's possible. I thought about this long ago, but I'm not 100% sure how to do it. I had plans to make one endpoint where all productions (movies and tv shows) are returned. However, each model is located in a different table. So I need to implement a strategy to add a chronology number that would be easy to change since each future production can be located in different places on the timeline.
@AugustoMarcelo Do you use any CMS or do you add the data directly into the db? If you use a CMS this would maybe be a good place to add some logic to make a GUI to drag and drop items and get the according index to save it in the db.
If thats not the case you could create a simple sql script that updates all the indices of the projects with a higher index than the new project with +1. Since there aren't a lot of projects being added this isn't really a big performance problem. It could be something like:
UPDATE projects
SET chronology = chronology +1WHERE chronology >=<<newProjectIndex here>>
@deBasMan21 Today I just update the data directly in the DB. I understood your solution, but it's not possible to be done today because movies and tv shows are stored in different tables. I can just add a new field to the tv show model and create a chronology between them (tv shows). But if I want to do a global endpoint to return both sorted chronologically, the tv shows will not be placed correctly.
I think the solution may be to use a float number in the tv shows. So if it's placed between the movie 1 and 2 (chronologically speaking) it could be stored with 1.1 or something like this.
Currently the movies have a chronology property with a number to order them chronologically. I would also like this property on the tv shows so all the projects can be ordered by that one property. I would love to hear if this is possible in some way.
The text was updated successfully, but these errors were encountered: