lib/strong_migrations/checks.rb in strong_migrations-1.1.0 vs lib/strong_migrations/checks.rb in strong_migrations-1.2.0
- old
+ new
@@ -96,9 +96,14 @@
if columns.is_a?(Array) && columns.size > 3 && !options[:unique]
raise_error :add_index_columns, header: "Best practice"
end
+ # safe_by_default goes through this path as well
+ if postgresql? && options[:algorithm] == :concurrently && adapter.index_corruption?
+ raise_error :add_index_corruption
+ end
+
# safe to add non-concurrently to new tables (even after inserting data)
# since the table won't be in use by the application
if postgresql? && options[:algorithm] != :concurrently && !new_table?(table)
if StrongMigrations.safe_by_default
safe_add_index(*args, **options)