2024_07_19_063615_create_chat_table.php
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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('chats', function (Blueprint $table) {
$table->id();
$table->integer('user_id')->nullable(false);
$table->integer('to_user_id');
$table->boolean('is_removed')->default(false);
$table->boolean('is_fixed')->default(false);
$table->dateTime('fixation_date')->nullable(true);
$table->dateTime('last_message_date')->nullable(false);
$table->integer('last_message_id')->nullable(false);
$table->dateTime('fixed_time')->nullable(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('chats');
}
};