Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention constraint name change in docs #983

Merged
merged 1 commit into from
Jan 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,7 @@ Let's add a foreign key to an example table:
}

"On delete" and "On update" actions are defined with a 'delete' and 'update' options array. Possibles values are 'SET_NULL', 'NO_ACTION', 'CASCADE' and 'RESTRICT'.
Constraint name can be changed with the 'constraint' option.

It is also possible to pass ``addForeignKey()`` an array of columns.
This allows us to establish a foreign key relationship to a table which uses a combined key.
Expand All @@ -1174,7 +1175,7 @@ This allows us to establish a foreign key relationship to a table which uses a c
->addForeignKey(array('user_id', 'follower_id'),
'followers',
array('user_id', 'follower_id'),
array('delete'=> 'NO_ACTION', 'update'=> 'NO_ACTION'))
array('delete'=> 'NO_ACTION', 'update'=> 'NO_ACTION', 'constraint' => 'user_follower_id'))
->save();
}

Expand Down