Move entrances to a separate table #3859
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new table
place_entranceinto which entrance nodes are now imported by osm2pgsql. This greatly simplifies processing for the entrances as they no longer have to go through the complex trigger mechanisms on updates. It also means we can remove the hack to suppress entrances in the placex table which caused addresses to be dropped.Migration warning
The PR takes the unusual step of modifying an existing migration. It drops the creation of the special index on place introduced with #3807. Setting up the index is slightly expensive and completely unnecessary, when going to the separate place_entrance table right away in the next step.
There is also no migration to move existing entrances from the place table to the place_entrance table. Again, this would be a rather expensive operation and only required by installations that directly follow master instead of using releases. If you do that, you can either just let the entrance table refill itself naturally with updates or manually copy over the entrances:
Fixes #3858.