Created
June 20, 2018 02:08
-
-
Save tghelere/82460cf64acd858a3bda92998565a3b9 to your computer and use it in GitHub Desktop.
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
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class ChangeAttributeCategoryPostTable extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::table('category_post', function (Blueprint $table) { | |
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade')->change(); | |
$table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade')->change(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
// | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment