CreateUserChatTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Support\Facades\Schema;
8
9
class CreateUserChatTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::create('user_chat', static function (Blueprint $table) {
14
            $table->bigInteger('user_id')->comment('Unique user identifier');
15
            $table->bigInteger('chat_id')->index('chat_id')->comment('Unique user or chat identifier');
16
            $table->primary(['user_id', 'chat_id']);
17
        });
18
    }
19
20
    public function down(): void
21
    {
22
        Schema::dropIfExists('user_chat');
23
    }
24
}
25