LoginSignup
1
2

More than 5 years have passed since last update.

[Laravel] SQLiteの外部キー制約を使えるようにする

Posted at

Laravelの開発でSQLiteを使っていたのだが、 デフォルトでSQLiteは外部キー制約を使えない らしい。

Screen Shot 2019-01-15 at 12.31.19.png

参考

外部キー制約を使えるようにする方法

config/database.php に以下のように追記する。

        'sqlite' => [
                         ...
            'foreign_key_constraints' => true,
        ],

参考

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2