Skip to content

Instantly share code, notes, and snippets.

@codejoy
Created July 29, 2015 17:08
Show Gist options
  • Save codejoy/1f9bff8eef5718c65a37 to your computer and use it in GitHub Desktop.
Save codejoy/1f9bff8eef5718c65a37 to your computer and use it in GitHub Desktop.
class CreateGroupsAddressJoinTable < ActiveRecord::Migration
def change
create_join_table(:groups, :addresses, 'group_locations') do |t|
# t.index [:group_id, :address_id]
t.index :address_id
t.index :group_id
t.integer :address_id
t.integer :group_id
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment