Skip to content

Commit

Permalink
Add additional details about dropping columns to 50-50 state document…
Browse files Browse the repository at this point in the history
…ation (#538)
  • Loading branch information
zachmargolis authored Apr 17, 2024
1 parent 98630fc commit e01840c
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit e01840c

Please sign in to comment.