foundersandcoders / open-tourism-platform

An open platform to facilitate the creation of apps to promote local tourism and business in Nazareth
MIT License
17 stars 3 forks source link

DB Field naming conventions #96

Closed mattlub closed 7 years ago

mattlub commented 7 years ago

In this PR I am populating the placeId field in the events model

I want to change the field name in the events model to place instead of placeId

The potential problems with this is confusion:


@des-des mentioned the possibility of sending it back as place when populated, but keeping the db field as placeId. The problem here is seeming inconsistency in the model between a POST and a GET. Does anyone do this?

Thoughts? @m4v15 @des-des @mantagen

mattlub commented 7 years ago

I am leaning towards @des-des suggestion now to be honest.

des-des commented 7 years ago

Yeah this is a really good question that I do not have an answer to. Maybe @mantagen has some thoughts. I think if you are on the fence, go for the path of least resistance.. ?

m4v15 commented 7 years ago

Yeah my whole issue with it was that in the DB it's just an id not a place itself, I'm pro calling it place id in the DB models but in the response object call it place. I see what you mean about the POST issue, but I don't think it's a massive problem - however you probably have more of an idea of this due doing stuff with Mohamed on the events app.

m4v15 commented 7 years ago

Although I guess by path of least resistance the easier thing would be to just call it place. Tbh I can also be convinced easily either way

mantagen commented 7 years ago

In the DB it's not just an id. It's a populatable reference to an entity, called a place.

... I'd probably go with place

mattlub commented 7 years ago

I think this is agreed, we will remove all appended id