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

[Fix] Bookmark column to support null #9009

Merged
merged 2 commits into from
Jan 12, 2024
Merged

Conversation

esizer
Copy link
Member

@esizer esizer commented Jan 11, 2024

🤖 Resolves #8977

👋 Introduction

Without a default value/nullable the bookmark column was causing issues for existing rows. This updates the migration to make it nullable with null as a default value. As well, it makes the field optional in the factory so we can simulate this locally as well.

🕵️ Details

I wasn't sure if we had already ran this migration but the AC mentioned updating the migration instead of creating a new one. If we have and it would be safer to create a new migration, let me know and I can fix that.

🧪 Testing

  mutation ToggleBookmark_Mutation($id: ID!) {
    togglePoolCandidateBookmark(id: $id)
  }
  1. Run migrations docker-compose exec -w /home/site/wwwroot/api webserver sh -c "php artisan migrate"
  2. Navigate to /graphiql
  3. Attempt to bookmark a candidate
  4. Confirm there is no error
  5. Confirm the new value is in the database
  6. Seed new data docker-compose exec -w /home/site/wwwroot/api webserver sh -c "php artisan migrate:fresh --seed"
  7. Confirm there are a mix of null, true, false bookmarked candidates
  8. Toggle the bookmark on a candidate with null from null to true from the grappql mutation
  9. Confirm it works as expected
  10. Repeat steps 8-9 between true and false

@petertgiles petertgiles self-requested a review January 12, 2024 13:48
Copy link
Contributor

@petertgiles petertgiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@petertgiles
Copy link
Contributor

I added an explicit deployment note and release to the issue.

@esizer esizer added this pull request to the merge queue Jan 12, 2024
Merged via the queue into main with commit 212d9b4 Jan 12, 2024
7 checks passed
@esizer esizer deleted the 8977-fix-bookmark-migration branch January 12, 2024 14:20
brindasasi pushed a commit that referenced this pull request Jan 15, 2024
* update bookmark migration to be nullable

* update candidate factory to seed some null bookmarks

(cherry picked from commit 212d9b4)
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.

🐛 New bookmarked column may require nullable/default value
2 participants