diff --git a/Gemfile b/Gemfile index 8911ce6c..4a1d6194 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,6 @@ gem 'puma' gem 'pundit' gem 'rails' gem 'sprockets-rails' -gem 'strong_migrations' gem 'stimulus-rails' gem 'tailwindcss-rails' gem 'turbo-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 54684744..5edbe58a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -279,8 +279,6 @@ GEM stimulus-rails (1.3.3) railties (>= 6.0.0) stringio (3.1.0) - strong_migrations (1.8.0) - activerecord (>= 5.2) tailwindcss-rails (2.3.0-aarch64-linux) railties (>= 6.0.0) tailwindcss-rails (2.3.0-arm64-darwin) @@ -335,7 +333,6 @@ DEPENDENCIES simplecov sprockets-rails stimulus-rails - strong_migrations tailwindcss-rails turbo-rails tzinfo-data diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb new file mode 100644 index 00000000..0fc44fbb --- /dev/null +++ b/config/initializers/geocoder.rb @@ -0,0 +1,15 @@ +# config/initializers/geocoder.rb +Geocoder.configure( + # geocoding service request timeout, in seconds (default 3): + # timeout: 5, + + # set default units to kilometers: + units: :km, + + # caching (see Caching section below for details): + cache: Redis.new, + cache_options: { + expiration: 1.day, # Defaults to `nil` + # prefix: "another_key:" # Defaults to `geocoder:` + } +) diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb deleted file mode 100644 index adc19cda..00000000 --- a/config/initializers/strong_migrations.rb +++ /dev/null @@ -1,26 +0,0 @@ -# Mark existing migrations as safe -StrongMigrations.start_after = 20230203144254 - -# Set timeouts for migrations -# If you use PgBouncer in transaction mode, delete these lines and set timeouts on the database user -StrongMigrations.lock_timeout = 10.seconds -StrongMigrations.statement_timeout = 1.hour - -# Analyze tables after indexes are added -# Outdated statistics can sometimes hurt performance -StrongMigrations.auto_analyze = true - -# Set the version of the production database -# so the right checks are run in development -# StrongMigrations.target_version = 10 - -# Add custom checks -# StrongMigrations.add_check do |method, args| -# if method == :add_index && args[0].to_s == "users" -# stop! "No more indexes on the users table" -# end -# end - -# Make some operations safe by default -# See https://github.com/ankane/strong_migrations#safe-by-default -# StrongMigrations.safe_by_default = true diff --git a/db/migrate/20240317171559_add_indicies_to_points_latitude_longitude.rb b/db/migrate/20240317171559_add_indicies_to_points_latitude_longitude.rb new file mode 100644 index 00000000..80d11aab --- /dev/null +++ b/db/migrate/20240317171559_add_indicies_to_points_latitude_longitude.rb @@ -0,0 +1,5 @@ +class AddIndiciesToPointsLatitudeLongitude < ActiveRecord::Migration[7.1] + def change + add_index :points, [:latitude, :longitude] + end +end diff --git a/db/schema.rb b/db/schema.rb index ca034644..eb181b9a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_03_15_215423) do +ActiveRecord::Schema[7.1].define(version: 2024_03_17_171559) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -57,6 +57,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_15_215423) do t.index ["connection"], name: "index_points_on_connection" t.index ["country"], name: "index_points_on_country" t.index ["import_id"], name: "index_points_on_import_id" + t.index ["latitude", "longitude"], name: "index_points_on_latitude_and_longitude" t.index ["trigger"], name: "index_points_on_trigger" end