2018-04-18 00:38:11 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
2022-05-23 21:01:33 -04:00
|
|
|
return new class extends Migration
|
2018-04-18 00:38:11 -04:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*/
|
2023-03-13 17:33:19 -04:00
|
|
|
public function up(): void
|
2018-04-18 00:38:11 -04:00
|
|
|
{
|
|
|
|
Schema::create('blog', function(Blueprint $table) {
|
2020-04-29 00:04:39 -04:00
|
|
|
$table->bigIncrements('id');
|
2019-04-17 17:29:40 -04:00
|
|
|
$table->bigInteger('user_id')->unsigned();
|
2018-04-18 00:38:11 -04:00
|
|
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
|
|
|
$table->string('title')->nullable();
|
|
|
|
$table->text('body')->nullable();
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*/
|
2023-03-13 17:33:19 -04:00
|
|
|
public function down(): void
|
2018-04-18 00:38:11 -04:00
|
|
|
{
|
|
|
|
Schema::drop('blog');
|
|
|
|
}
|
2022-05-23 21:01:33 -04:00
|
|
|
};
|