What does onDelete('cascade') mean?

后端 未结 4 1279
说谎
说谎 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:41

    If you're using mysql, take a look at the documentation.

    In your case it means: If the user is deleted, the post will also be deleted.

提交回复
热议问题