36 lines
899 B
PHP
Executable File
36 lines
899 B
PHP
Executable File
<?php
|
|
|
|
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('messages', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('ticket_id')->references('id')->on('tickets')->onDelete('cascade')->onUpdate('cascade');
|
|
$table->boolean('is_client'); //if client diplay as client's message, else display as admin reply
|
|
$table->string('content');
|
|
$table->foreignId('admin_id')->nullable();;
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('messages');
|
|
}
|
|
};
|