Completed
Push — master ( 0d7181...2d779c )
by Anton
23s
created

CreateSenseUrlsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 26
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of Laravel Sense.
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 Illuminate\Support\Facades\DB;
15
use Illuminate\Support\Facades\Schema;
16
use Illuminate\Database\Schema\Blueprint;
17
use Illuminate\Database\Migrations\Migration;
18
19
class CreateSenseUrlsTable extends Migration
20
{
21
    /**
22
     * Run the migrations.
23
     *
24
     * @return void
25
     */
26
    public function up(): void
27
    {
28
        Schema::create('sense_urls', function (Blueprint $table) {
29
            $table->bigIncrements('id');
30
            $table->mediumText('address');
31
            $table->timestamps();
32
        });
33
34
        DB::statement('ALTER TABLE `sense_urls` ADD FULLTEXT sense_urls_address_index(`address`)');
35
    }
36
37
    /**
38
     * Reverse the migrations.
39
     *
40
     * @return void
41
     */
42
    public function down(): void
43
    {
44
        Schema::dropIfExists('sense_urls');
45
    }
46
}
47