-
Notifications
You must be signed in to change notification settings - Fork 113
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
Update fax
to is_fax
boolean label
#3212
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this break existing pages that have a value for fax
stored in their database JSON value? There needs to be some kind of data migration to rename a block like this.
@chosak The standard migration doesn't handle this? I'm confused. |
@Scotchester no, because you're not renaming a Django model field, you're renaming a block in a Wagtail StreamField. Recall that StreamField content is stored as JSON in the database, e.g. there's a database column named for the field name (like Changing the field name would result in a Django migration that changed the DB column name. But just changing the block name doesn't trigger any kind of automatic migration of the DB content that already exists. The links @anselmbradford posted above are some examples of manual migrations we've done in the past to address this. See also this Wagtail issue on the subject. |
Ahhh, that makes sense, now. Thanks for the explanation, @chosak. |
There's a section of the documentation on migrating stream fields: https://cfpb.github.io/consumerfinance.gov/migrations/ |
@anselmbradford In light of the need to write a data migration for this, is it worth doing anymore? |
I'm rotating to maintenance & response after next sprint, so thinking I'll re-visit this then. If it gets swamped by other priorities I'll close it. |
😭 |
Did you determine it's not worth the effort to write the migration? |
Not so much, I was just keeping my word from my Dec 15 comment. #3213 seems actually bug-like and the semantics here could be incorporated into that, hopefully. |
I guess I just don't see the point of closing it if it's something that we still think is worth doing. But I take your point that it could be rolled into #3213. |
Changes
fax
boolean label tois_fax
, per TODO comment.Testing
python cfgov/manage.py migrate
.Is this number a fax?
checkbox works.Screenshots
Notes
Opened In Contact > Phone, is_fax should apply to EACH number not ALL numbers. #3213