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 9, 2020
1 parent 23ef0c9 commit 283b453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .regen
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26
28a
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 283b453

Please sign in to comment.