Cross Reference:
xref
: /
ontohub
/
db
/
migrate
/
20120308144855_create_team_users.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
20120308144855_create_team_users.rb revision c622fbf3120c732e74ab43bb0457388b477e6898
class
CreateTeamUsers
<
ActiveRecord
::
Migration
def
change
create_table
:
team_users
do
|t|
t.references
:
team
, :
null
=>
false
t.references
:
user
, :
null
=>
false
t.references
:
creator
t.boolean
:
admin
, :
default
=>
false
, :
null
=>
false
end
change_table
:
team_users
do
|t|
t.index
[:
team_id
, :
user_id
], :
unique
=>
true
t.foreign
_key
:
teams
, :
dependent
=> :
delete
t.index
:
user_id
t.foreign
_key
:
users
, :
dependent
=> :
delete
t.index
:
creator_id
t.foreign
_key
:
users
, :
dependent
=> :
nullify
, :
column
=> :
creator_id
end
end
end