Kundesone/database/migrations/2024_06_26_111517_create_co...

31 lines
743 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('comments', function (Blueprint $table) {
$table->id();
$table->foreignId('ticket_id')->constrained('tickets')->onDelete('cascade');
$table->foreignId('author')->constrained('users')->onDelete('cascade');
$table->text('comment');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('comments');
}
};