1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 16:53:23 -05:00
BikeShed-1/db/migrate/20120325031259_create_team_memberships.example

18 lines
471 B
Plaintext
Raw Normal View History

2012-12-04 00:46:15 -05:00
class CreateTeamMemberships < ActiveRecord::Migration
def up
create_table :team_memberships do |t|
t.references :user, :null => false
t.references :team, :null => false
t.timestamps
end
add_index :team_memberships, :user_id
add_index :team_memberships, :team_id
end
def down
remove_index :team_memberships, :column => :team_id
remove_index :team_memberships, :column => :user_id
drop_table :team_memberships
end
end