gems: add strong_migrations

This commit is contained in:
Pierre de La Morinerie 2022-03-15 13:59:59 +01:00
parent 1eebc2f1e1
commit 2e04435117
3 changed files with 30 additions and 0 deletions

View file

@ -80,6 +80,7 @@ gem 'sentry-ruby'
gem 'sib-api-v3-sdk' gem 'sib-api-v3-sdk'
gem 'skylight' gem 'skylight'
gem 'spreadsheet_architect' gem 'spreadsheet_architect'
gem 'strong_migrations' # lint database migrations
gem 'typhoeus' gem 'typhoeus'
gem 'warden' gem 'warden'
gem 'webpacker' gem 'webpacker'

View file

@ -691,6 +691,8 @@ GEM
actionpack (>= 5.2) actionpack (>= 5.2)
activesupport (>= 5.2) activesupport (>= 5.2)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
strong_migrations (0.8.0)
activerecord (>= 5.2)
swd (1.3.0) swd (1.3.0)
activesupport (>= 3) activesupport (>= 3)
attr_required (>= 0.0.5) attr_required (>= 0.0.5)
@ -875,6 +877,7 @@ DEPENDENCIES
spreadsheet_architect spreadsheet_architect
spring spring
spring-commands-rspec spring-commands-rspec
strong_migrations
timecop timecop
typhoeus typhoeus
vcr vcr

View file

@ -0,0 +1,26 @@
# Mark existing migrations as safe
StrongMigrations.start_after = 20220315125851
# 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