Skip to content

Conversation

@rachaelkiteme
Copy link
Collaborator

@rachaelkiteme rachaelkiteme commented Aug 16, 2018

In your PR did you:
Fixes: #1345
Run a migration to set the default value for jurisdiction enum to "none"

  • Include a description of the changes?
  • Mention the issue the PR addresses?
  • Include screenshots of any changes to the UI?
  • Isolate any changes to gems (meaning that any new, updated, or removed gems and resulting code changes should be in their own PR)?
  • Add and/or update specs for your code?

@rlgreen91
Copy link
Contributor

@rachaelkiteme The default value for the value for jurisdiction should be none, not jurisdiction_type. Just change the column name and run rake db:migrate:redo to fix the migration instead of creating a new one.

@rachaelkiteme
Copy link
Collaborator Author

rachaelkiteme commented Aug 17, 2018 via email

@rlgreen91
Copy link
Contributor

Is it? Then try just adding a line to change the default value of the jursidiction column to 'none'.

Here's what's going on. We want to use what are called enum types to represent the possible jursidictions an agency might have (later we'll do this with subjects and gender). Right now, we use a gem to provide that functionality. However, ActiveRecord has enum types built-in, so it doesn't really make sense for us to use a gem to do that. We want to switch, which will take a few steps, but at the same time we want to ensure that there is 0 downtime for this feature - that people can still assign a jurisdiction to an agency. That's not too bad - this whole set of issues is written to allow us to make that change with 0 downtime. However, there's already a value set for the name jurisdiction - if we want the final version, with the ActiveRecord enums, to have that name, then we need to rename the original so we don't end up with conflicts. That's where it can get confusing. Here, we're just declaring a default value of none for the new ActiveRecord jurisdiction enum before we start using it.

If you get a chance, try reading all of the issues in this set and go through them in order. Hopefully it'll become clear how they connect to one another.

@rlgreen91 rlgreen91 merged commit 6518404 into master Aug 21, 2018
@rlgreen91 rlgreen91 deleted the set_default_value_for_jurisdiction_enum_#1325 branch August 21, 2018 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants