What does onDelete('cascade') mean?

后端 未结 4 1317
说谎
说谎 2021-02-02 10:00
Schema::table(\'posts\', function (Blueprint $table) {
    $table->integer(\'user_id\')->unsigned();
    $table->foreign(\'user_id\')->references(\'id\')->         


        
4条回答
  •  [愿得一人]
    2021-02-02 10:36

    It means that if you delete the 'user' linked, the 'posts' linked to that user will also automatically be deleted.

提交回复
热议问题