27 lines
615 B
PHP
27 lines
615 B
PHP
<?php
|
|
|
|
use App\Models\Deal;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('comments', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('text');
|
|
$table->foreignIdFor(Deal::class);
|
|
$table->foreignIdFor(User::class);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('comments');
|
|
}
|
|
};
|