From: Tom Hughes Date: Sat, 3 Dec 2022 11:00:33 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/3825' X-Git-Tag: live~1974 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/39cc056fa2e657a70e9fc0f107ae754842265b55?hp=f4369334333a5444492c616ac32cc3b842f6a7ad Merge remote-tracking branch 'upstream/pull/3825' --- diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 79811c612..aa31089c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,6 @@ jobs: sudo systemctl start postgresql sudo -u postgres createuser -s $(id -un) createdb openstreetmap - psql -c "CREATE EXTENSION btree_gist" openstreetmap psql -f db/functions/functions.sql openstreetmap - name: Configure rails run: | diff --git a/INSTALL.md b/INSTALL.md index b14a2d32b..b9aa1a329 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -188,14 +188,6 @@ To create the three databases - for development, testing and production - run: bundle exec rake db:create ``` -### PostgreSQL Btree-gist Extension - -We need to load the `btree-gist` extension, which is needed for showing changesets on the history tab. - -``` -psql -d openstreetmap -c "CREATE EXTENSION btree_gist" -``` - ### PostgreSQL Functions We need to install some special functions into the PostgreSQL database: diff --git a/db/migrate/028_add_more_changeset_indexes.rb b/db/migrate/028_add_more_changeset_indexes.rb index d7a6df7ab..fcbc24ed7 100644 --- a/db/migrate/028_add_more_changeset_indexes.rb +++ b/db/migrate/028_add_more_changeset_indexes.rb @@ -1,5 +1,7 @@ class AddMoreChangesetIndexes < ActiveRecord::Migration[4.2] def self.up + enable_extension "btree_gist" + add_index "changesets", ["created_at"], :name => "changesets_created_at_idx" add_index "changesets", ["closed_at"], :name => "changesets_closed_at_idx" add_index "changesets", %w[min_lat max_lat min_lon max_lon], :name => "changesets_bbox_idx", :using => "GIST" @@ -9,5 +11,7 @@ class AddMoreChangesetIndexes < ActiveRecord::Migration[4.2] remove_index "changesets", :name => "changesets_bbox_idx" remove_index "changesets", :name => "changesets_closed_at_idx" remove_index "changesets", :name => "changesets_created_at_idx" + + disable_extension "btree_gist" end end diff --git a/docker/postgres/openstreetmap-postgres-init.sh b/docker/postgres/openstreetmap-postgres-init.sh index 1a7c58857..53c0ba454 100755 --- a/docker/postgres/openstreetmap-postgres-init.sh +++ b/docker/postgres/openstreetmap-postgres-init.sh @@ -8,8 +8,5 @@ psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" <<-EOSQL GRANT ALL PRIVILEGES ON DATABASE openstreetmap TO openstreetmap; EOSQL -# Create btree_gist extensions -psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE EXTENSION btree_gist" openstreetmap - # Define custom functions psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -f "/usr/local/share/osm-db-functions.sql" openstreetmap diff --git a/package.json b/package.json index 4de2e943e..3f4432e9d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "jquery-simulate": "^1.0.2", "js-cookie": "^3.0.0", "leaflet": "^1.8.0", - "leaflet.locatecontrol": "^0.78.0", + "leaflet.locatecontrol": "^0.79.0", "osm-community-index": "^5.2.0", "qs": "^6.9.4" }, diff --git a/script/vagrant/setup/provision.sh b/script/vagrant/setup/provision.sh index c17ddd1d6..bfe12a3c6 100644 --- a/script/vagrant/setup/provision.sh +++ b/script/vagrant/setup/provision.sh @@ -36,9 +36,6 @@ if [ "$db_user_exists" != "1" ]; then sudo -u postgres createuser -s vagrant sudo -u vagrant createdb -E UTF-8 -O vagrant openstreetmap sudo -u vagrant createdb -E UTF-8 -O vagrant osm_test - # add btree_gist extension - sudo -u vagrant psql -c "create extension btree_gist" openstreetmap - sudo -u vagrant psql -c "create extension btree_gist" osm_test fi diff --git a/yarn.lock b/yarn.lock index 7b4b7162a..37f66e368 100644 --- a/yarn.lock +++ b/yarn.lock @@ -493,10 +493,10 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -leaflet.locatecontrol@^0.78.0: - version "0.78.0" - resolved "https://registry.yarnpkg.com/leaflet.locatecontrol/-/leaflet.locatecontrol-0.78.0.tgz#fa87ac57fa79d2797f8f3e673d9eb3f104688310" - integrity sha512-3cElL7dBPOMkzHTOWUA/SLogrWrmfqYkbIXAikbRD0QcEef4jJRYYVhkcUUTprS2cOQzg2UiR475v8jemJiXRg== +leaflet.locatecontrol@^0.79.0: + version "0.79.0" + resolved "https://registry.yarnpkg.com/leaflet.locatecontrol/-/leaflet.locatecontrol-0.79.0.tgz#0236b87c699a49f9ddb2f289941fbc0d3c3f8b62" + integrity sha512-h64QIHFkypYdr90lkSfjKvPvvk8/b8UnP3m9WuoWdp5p2AaCWC0T1NVwyuj4rd5U4fBW3tQt4ppmZ2LceHMIDg== leaflet@^1.8.0: version "1.9.3"