Skip to content

Migrate from String Based -> Integer Based Enums#158

Open
cjbmartinez wants to merge 1 commit into
developfrom
feature/migrate-to-integer-based-enums
Open

Migrate from String Based -> Integer Based Enums#158
cjbmartinez wants to merge 1 commit into
developfrom
feature/migrate-to-integer-based-enums

Conversation

@cjbmartinez

Copy link
Copy Markdown
Collaborator

Description

Moved to using Integer Based Enums for the following table columns

  • Transcript#process_status
  • SiteAlert#level
  • UserRole#transcribing_role

Changes

  • Create a 3 step migration to be able to successfully update from string to integer based enum, While ensuring all existing records will still have their data intact
  • Minor updates on enum usage and raw SQL Queries using the stirng based enums

Comment thread app/models/site_alert.rb

# TODO: Convert to integer-based enum
enum :level, { status: 'status', warning: 'warning', error: 'error' }
enum :level, { status: 0, warning: 1, error: 2 }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice!

@neumerance

Copy link
Copy Markdown
Collaborator

PR looks good to me

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.

2 participants