def up
if Example.where.not(foo_column: nil).exists?
raise 'Example.foo_column has some value'
end
remove_column :examples, :foo_column
end
Created
June 6, 2024 23:13
-
-
Save YumaInaura/815b2e36a19c8e247b06ebe458d7cac1 to your computer and use it in GitHub Desktop.
Rails - Check before delete column migration, column value exist or not
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment