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

[5.2] Enable or disable Foreign Key Constraints #13333

Merged
merged 1 commit into from
Apr 28, 2016
Merged

[5.2] Enable or disable Foreign Key Constraints #13333

merged 1 commit into from
Apr 28, 2016

Conversation

srmklive
Copy link
Contributor

@srmklive srmklive commented Apr 27, 2016

This PR allows user to enable/disable foreign key checks dynamically. As mentioned in issue #2502, we need to utilize the DB facade to write queries in this regard. This PR removes that constraint.

To enable/disable foreign key checks while creating migrations:

// Disable foreign key checks
Schema::disableForeignKeyConstraints();

// Enable foreign key checks
Schema::enableForeignKeyConstraints();

@GrahamCampbell GrahamCampbell changed the title Enable or disable Foreign Key Constraints [5.2] Enable or disable Foreign Key Constraints Apr 27, 2016
@taylorotwell taylorotwell merged commit d023c08 into laravel:5.2 Apr 28, 2016
@srmklive
Copy link
Contributor Author

@taylorotwell Can i send these changes over to 5.1 as well?

@GrahamCampbell
Copy link
Member

No, sorry. This is not a bug fix, so we don't merge it back.

@GrahamCampbell
Copy link
Member

LTS is there so people can continue using it knowing it'll be secure more than anything else. For the latest features, you need to be tracking the current stable.

@srmklive
Copy link
Contributor Author

@GrahamCampbell thanks for pointing it out. Will follow the guidelines you mentioned.

@rtucek
Copy link

rtucek commented May 12, 2016

Hi,
the PR of the documentation (laravel/docs#2294) has been merged and published too early.
Either it should be temporary reversed or this PR will be released shortly. It's confusing the way it is right now :/

@abrahamgreyson
Copy link
Contributor

That's fantastic.

@Mixpeal
Copy link

Mixpeal commented Jul 16, 2016

it works, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants