Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional details about dropping columns to 50-50 state documentation #538

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions _articles/manage-50-50-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,22 @@ existing data.

### Remove a table or field
* Deploy 1: Remove all reads in the code
* If removing a field from an in-use table, mark that field as an ignored columns.
This is necessary in the IDP because it is [configured to explicitly load columns][idp-explicit-config]
instead of using `SELECT *`.

```ruby
class MyTable < ApplicationRecord
self.ignored_columns = %w[my_column_to_drop]
end
```

* Deploy 2: Remove all writes in the code
* Deploy 3: Remove the table/field
* If removing a field, the field can be removed from the ignored columns list
* If removing a table, the entire model file can be removed

[idp-explicit-config]: https://github.com/18F/identity-idp/blob/c4a0cc098867a209f8196c312024b24001b6fa9b/app/models/application_record.rb#L6-L7

## Persistent data structures in redis

Expand Down
Loading