diff --git a/config/initializers/strong_migrations.rb b/config/initializers/strong_migrations.rb index dfc903e2..78012899 100644 --- a/config/initializers/strong_migrations.rb +++ b/config/initializers/strong_migrations.rb @@ -1,31 +1,31 @@ # frozen_string_literal: true -return unless Rails.env.development? +# return unless Rails.env.development? -# Mark existing migrations as safe -StrongMigrations.start_after = 20_250_122_150_500 +# # Mark existing migrations as safe +# StrongMigrations.start_after = 20_250_122_150_500 -# Set timeouts for migrations -# PgBouncer in transaction mode doesn't support SET commands -# Timeouts should be set on the database user instead -# StrongMigrations.lock_timeout = 10.seconds -# StrongMigrations.statement_timeout = 1.hour +# # Set timeouts for migrations +# # PgBouncer in transaction mode doesn't support SET commands +# # Timeouts should be set on the database user instead +# # 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 +# # 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 +# # 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 +# # 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 +# # 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/20250513164521_add_visited_countries_to_trips.rb b/db/migrate/20250513164521_add_visited_countries_to_trips.rb index fd9d7a4e..27797428 100644 --- a/db/migrate/20250513164521_add_visited_countries_to_trips.rb +++ b/db/migrate/20250513164521_add_visited_countries_to_trips.rb @@ -2,10 +2,10 @@ class AddVisitedCountriesToTrips < ActiveRecord::Migration[8.0] def change - safety_assured do + # safety_assured do execute <<-SQL ALTER TABLE trips ADD COLUMN visited_countries JSONB DEFAULT '{}'::jsonb NOT NULL; SQL - end + # end end end diff --git a/db/migrate/20250918215512_add_h3_hex_ids_to_stats.rb b/db/migrate/20250918215512_add_h3_hex_ids_to_stats.rb index cdb627e9..fbb19073 100644 --- a/db/migrate/20250918215512_add_h3_hex_ids_to_stats.rb +++ b/db/migrate/20250918215512_add_h3_hex_ids_to_stats.rb @@ -5,10 +5,10 @@ class AddH3HexIdsToStats < ActiveRecord::Migration[8.0] def change add_column :stats, :h3_hex_ids, :jsonb, default: {}, if_not_exists: true - safety_assured do + # safety_assured do add_index :stats, :h3_hex_ids, using: :gin, where: "(h3_hex_ids IS NOT NULL AND h3_hex_ids != '{}'::jsonb)", algorithm: :concurrently, if_not_exists: true - end + # end end end