diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b8ed7a69236..371a9828d81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -187,7 +187,7 @@ specs: POSTGRES_HOST_AUTH_METHOD: trust RAILS_ENV: test services: - - name: postgis/postgis:13-3.3 + - name: postgres:13.9 alias: db-postgres command: ['--fsync=false', '--synchronous_commit=false', '--full_page_writes=false'] - name: redis:7.0 diff --git a/Brewfile b/Brewfile index 0ebe762e20f..2018d5ff118 100644 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,4 @@ brew 'postgresql@14' -brew 'postgis' brew 'redis' brew 'node@20' brew 'yarn' diff --git a/Gemfile b/Gemfile index 291ab73a93b..c231053e3a1 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,6 @@ ruby "~> #{File.read(File.join(__dir__, '.ruby-version')).strip}" gem 'rails', '~> 7.1.3' -gem 'activerecord-postgis-adapter', '~> 9.0' gem 'ahoy_matey', '~> 3.0' gem 'aws-sdk-kms', '~> 1.4' gem 'aws-sdk-cloudwatchlogs', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 89c453cc548..07ecff1b76e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,9 +136,6 @@ GEM activemodel (= 7.1.3.2) activesupport (= 7.1.3.2) timeout (>= 0.4.0) - activerecord-postgis-adapter (9.0.1) - activerecord (~> 7.1.0) - rgeo-activerecord (~> 7.0.0) activestorage (7.1.3.2) actionpack (= 7.1.3.2) activejob (= 7.1.3.2) @@ -576,10 +573,6 @@ GEM railties (>= 5.0) retries (0.0.5) rexml (3.2.6) - rgeo (3.0.0) - rgeo-activerecord (7.0.1) - activerecord (>= 5.0) - rgeo (>= 1.0.0) rotp (6.3.0) rouge (4.2.0) rqrcode (2.1.0) @@ -749,7 +742,6 @@ PLATFORMS ruby DEPENDENCIES - activerecord-postgis-adapter (~> 9.0) ahoy_matey (~> 3.0) aws-sdk-cloudwatchlogs aws-sdk-kms (~> 1.4) diff --git a/config/database.yml b/config/database.yml index a6b5a6a2a4c..0b623f08000 100644 --- a/config/database.yml +++ b/config/database.yml @@ -24,11 +24,11 @@ defaults: &defaults development: primary: <<: *defaults - adapter: postgis + adapter: postgresql migrations_paths: db/primary_migrate read_replica: <<: *defaults - adapter: postgis + adapter: postgresql replica: true worker_jobs: <<: *defaults @@ -38,7 +38,7 @@ development: test: primary: &test <<: *defaults - adapter: postgis + adapter: postgresql pool: 10 checkout_timeout: 10 database: <%= ENV['POSTGRES_DB'] || "identity_idp_test#{ENV['TEST_ENV_NUMBER']}" %> @@ -47,7 +47,7 @@ test: migrations_paths: db/primary_migrate read_replica: <<: *test - adapter: postgis + adapter: postgresql replica: true worker_jobs: <<: *test @@ -80,7 +80,7 @@ test: production: primary: <<: *defaults - adapter: postgis + adapter: postgresql database: <%= IdentityConfig.store.database_name %> username: <%= IdentityConfig.store.database_username %> host: <%= IdentityConfig.store.database_socket.present? ? IdentityConfig.store.database_socket : IdentityConfig.store.database_host %> @@ -93,7 +93,7 @@ production: migrations_paths: db/primary_migrate read_replica: <<: *defaults - adapter: postgis + adapter: postgresql database: <%= IdentityConfig.store.database_name %> username: <%= IdentityConfig.store.database_readonly_username %> host: <%= IdentityConfig.store.database_read_replica_host %> diff --git a/db/primary_migrate/20230518221444_add_postgis_extension_to_database.rb b/db/primary_migrate/20230518221444_add_postgis_extension_to_database.rb index 3e8476ebf8d..c772c4060ac 100644 --- a/db/primary_migrate/20230518221444_add_postgis_extension_to_database.rb +++ b/db/primary_migrate/20230518221444_add_postgis_extension_to_database.rb @@ -1,5 +1,8 @@ class AddPostgisExtensionToDatabase < ActiveRecord::Migration[7.0] def change - enable_extension 'postgis' + # In the time since we added this extension, we have removed it and + # also removed the postgis-compatible images from our CI pipeline, + # so running this old migration fails + # enable_extension 'postgis' end end diff --git a/db/schema.rb b/db/schema.rb index 1af808446ec..ca81df3b182 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,13 +10,12 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_04_04_154024) do +ActiveRecord::Schema[7.1].define(version: 2024_04_11_163520) do # These are extensions that must be enabled in order to support this database enable_extension "citext" enable_extension "pg_stat_statements" enable_extension "pgcrypto" enable_extension "plpgsql" - enable_extension "postgis" create_table "account_reset_requests", force: :cascade do |t| t.integer "user_id", null: false diff --git a/docs/local-development.md b/docs/local-development.md index 344db74541b..dd45752c211 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -23,8 +23,6 @@ If not using macOS: - [rbenv](https://github.com/rbenv/rbenv) (lets you install and switch between different versions of Ruby) - Ruby. Choose the version [in the `.ruby-version` file](../.ruby-version) - [PostgreSQL](http://www.postgresql.org/download/) - - [PostGIS](https://postgis.net/documentation/getting_started/#installing-postgis) - - Note: if you run into errors installing `postgis` or creating the database, check [the troubleshooting docs](./troubleshooting.md#errors-related-to-the-databse). - [Redis 7+](http://redis.io/) - [Node.js v20](https://nodejs.org) - [Yarn](https://yarnpkg.com/en/) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index f7b42a19317..0867ca17ede 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -8,30 +8,6 @@ $ bundle install $ yarn install ``` -### Errors related to the database - -One error you might see is: - -``` -Caused by: -ActiveRecord::StatementInvalid: PG::FeatureNotSupported: ERROR: extension "postgis" is not available -DETAIL: Could not open extension control file "/opt/homebrew/opt/postgresql@15/share/postgresql@15/extension/postgis.control": No such file or directory. -HINT: The extension must first be installed on the system where PostgreSQL is running. -``` - -If you see the above message: - -- double check that `postgis` is installed with `brew list` -- if `postgis` is listed, it means when you brew installed you might have installed `postgis` in a different postgresql db than the app is using - - in this case, look at `brew list` again, and remove any `postgres` db that is not listed in [the Brewfile](../Brewfile) (`brew uninstall __`) - - if you try to run the migration now you might get a: - ``` - connection to server at "::1", port 5432 failed: Connection refused - Is the server running on that host and accepting TCP/IP connections? - ``` - - this likely means postgres is no longer running - - try `brew services start postgresql@14` (or your version) and then re-run the migration - ## I am receiving errors when creating the development and test databases If you receive the following error (where _whoami_ == _your username_):