Skip to content

Commit

Permalink
Changing column type [Needs Upgrade Notes]
Browse files Browse the repository at this point in the history
I do not believe this change column is likely used by adopters; It has
to do with adding permissions to an individual Sipity::Entity.

The change is necessary because the foreign key was created as a string,
but the associated primary key on the other table was an integer.

This is likely a bad copy paste job from ndlib/sipity
  • Loading branch information
jeremyf committed Jul 15, 2020
1 parent e4bf3af commit 29b81cf
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class ChangeSipityEntitySpecificResponsibility < ActiveRecord::Migration<%= migration_version %>
def change
if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
change_column :sipity_entity_specific_responsibilities, :entity_id, 'integer USING CAST(entity_id AS integer)'
else
change_column :sipity_entity_specific_responsibilities, :entity_id, :integer
end
end
end

0 comments on commit 29b81cf

Please sign in to comment.