web/database/migrations/2022_04_12_154421_create_st...

38 lines
866 B
PHP

<?php
use App\Enums\CreatorType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('statuses', function (Blueprint $table) {
$table->id();
$table->bigInteger('creator_id');
$table->bigInteger('creator_type')->default(CreatorType::User->value);
$table->bigInteger('group_id')->nullable();
$table->string('content', 140);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('statuses');
}
};