Skip to content

Commit

Permalink
Merge pull request #2976 from manyfold3d/fix-role-name-migration
Browse files Browse the repository at this point in the history
Fix default role name migration
  • Loading branch information
Floppy authored Oct 17, 2024
2 parents cb2d4ee + 8e5ffcc commit 1d529e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/data/20240830151650_rename_default_roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

class RenameDefaultRoles < ActiveRecord::Migration[7.1]
def up
Role.find_by(name: :editor)&.update!(name: :moderator)
Role.find_by(name: :viewer)&.update!(name: :member)
Role.find_by(name: :editor)&.update!(name: :moderator) unless Role.find_by(name: :moderator)
Role.find_by(name: :viewer)&.update!(name: :member) unless Role.find_by(name: :member)
end

def down
Expand Down

0 comments on commit 1d529e5

Please sign in to comment.