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 Jun 30, 2020
1 parent 28c8b53 commit 7c4aeec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .regen
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26
26d
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class ChangeSipityEntitySpecificResponsibility < ActiveRecord::Migration<%= migration_version %>
def change
if defined?(Sipity::EntitySpecificResponsibility)
if Sipity::EntitySpecificResponsibility.connect.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
end

0 comments on commit 7c4aeec

Please sign in to comment.