-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an sqlite config option to enable foreign key constraints
For Sqlite, foreign key constraints need to be explicitly enabled for every database connection. So enabling them in the migrations (as suggested by the documentation) does not work. This PR enables the contraints for every connection to an sqlite database that has the config option `foreign_key_constraints` set to `true`. If the option is not set, nothing changes, so no breaking change is introduced. As foreign key constraints are the default behavior for all other databases I suggest switching this around for the next release and enable foreign keys unless this is set to `false`. If this is accepted I'll submit two more PRs for documentation and laravel/laravel.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters