Skip to content

Commit

Permalink
Improve removing a column docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fatkodima committed Feb 10, 2024
1 parent 5ec8fcd commit b128158
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ end
end
```

4. Remove column ignoring from `User` model
4. Remove column ignoring from step 1
5. Deploy

### Adding a column with a default value
Expand Down
4 changes: 2 additions & 2 deletions lib/online_migrations/error_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def change
Active Record caches database columns at runtime, so if you drop a column, it can cause exceptions until your app reboots.
A safer approach is to:
1. Ignore the column(s):
1. Ignore the column:
class <%= model %> < ApplicationRecord
self.ignored_columns = <%= columns %>
Expand All @@ -310,7 +310,7 @@ def change
end
end
4. Remove columns ignoring
4. Remove column ignoring from step 1
5. Deploy
<% end %>",

Expand Down
4 changes: 2 additions & 2 deletions test/command_checker/removing_columns_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_remove_column
Active Record caches database columns at runtime, so if you drop a column, it can cause exceptions until your app reboots.
A safer approach is to:
1. Ignore the column(s):
1. Ignore the column:
class User < ApplicationRecord
self.ignored_columns = ["email"]
Expand All @@ -50,7 +50,7 @@ def change
end
end
4. Remove columns ignoring
4. Remove column ignoring from step 1
5. Deploy
MSG
end
Expand Down

0 comments on commit b128158

Please sign in to comment.