Passed
Push — master ( 0a2dad...a9b714 )
by Anton
04:22 queued 01:15
created

CreateLoveReactionTypesTable::down()   A

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
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Laravel Love.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
use Cog\Laravel\Love\ReactionType\Models\ReactionType;
15
use Cog\Laravel\Love\Support\Database\Migration;
16
use Illuminate\Database\Schema\Blueprint;
17
18
return new class extends Migration
19
{
20
    /**
21
     * Run the migrations.
22
     */
23
    public function up(): void
24
    {
25
        $this->schema->create((new ReactionType())->getTable(), function (Blueprint $table) {
26
            $table->bigIncrements('id');
27
            $table->string('name');
28
            $table->tinyInteger('mass');
29
            $table->timestamps();
30
31
            $table->index('name');
32
        });
33
    }
34
35
    /**
36
     * Reverse the migrations.
37
     */
38
    public function down(): void
39
    {
40
        $this->schema->dropIfExists((new ReactionType())->getTable());
41
    }
42
};
43