gravitystorm / openstreetmap-website

The Rails application powering OpenStreetMap
http://www.openstreetmap.org/
GNU General Public License v2.0
2 stars 1 forks source link

rename database tables #18

Open gravitystorm opened 7 years ago

gravitystorm commented 7 years ago

For hysterical raisins many of the database tables don't match the model names. There's nothing to be gained from this, and I keep getting caught out by this (e.g. the relation_members table is not related to the RelationMember model, and the way_nodes table is not related to the WayNode model).

It would be good to rename them. Doing so here is easy, but I assume that the difficulty is in coordinating the change with other tools like osmosis and the various dumpers.

pnorman commented 5 years ago

It would be good to rename them. Doing so here is easy, but I assume that the difficulty is in coordinating the change with other tools like osmosis and the various dumpers.

A view (create view old_name as select * from new name;) should handle everything except planet-dump-ng. That might need more changes because it works on the dump file.

gravitystorm commented 5 years ago

Good point, I hadn't thought of using views.