Skip to content

Commit

Permalink
fixed upgrade migration for RDBMS systems different that sqlite, at l…
Browse files Browse the repository at this point in the history
…east for mysql works
  • Loading branch information
molpe committed Aug 31, 2009
1 parent d6d6ca0 commit 0f01e45
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db/migrate/006_migrate_to_acts_as_shareable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ def self.up
Share.destroy_all
current_sharings = ActiveRecord::Base.connection.execute("select * from group_sharings")
current_sharings.each do |r|
share = Share.create(:id => r["id"],
:user_id => r["shared_by"], :status => r["status"],
:shareable_type => r["shareable_type"], :shareable_id => r["shareable_id"],
:shared_to_type => "Group", :shared_to_id => r["group_id"],
:created_at => r["created_at"], :updated_at => r["updated_at"])
share = Share.create(:id => r[0],
:user_id => r[4], :status => r[5],
:shareable_type => r[3], :shareable_id => r[2],
:shared_to_type => "Group", :shared_to_id => r[1],
:created_at => r[6], :updated_at => r[7])
end

drop_table :group_sharings
Expand Down

0 comments on commit 0f01e45

Please sign in to comment.