CreateRatingTable::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
eloc 1
nc 1
nop 0
dl 0
loc 3
c 1
b 0
f 0
cc 1
rs 10
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateRatingTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     */
12
    public function up()
13
    {
14
        Schema::create(config('rating.table_name', 'ratings'), function (Blueprint $table) {
15
            $table->increments('id');
16
            $table->string('rater_type')->nullable();
17
            $table->integer('rater_id')->nullable();
18
            $table->string('rateable_type');
19
            $table->string('rateable_id');
20
            $table->float('rating', 9, 2);
21
            $table->timestamps();
22
        });
23
    }
24
25
    /**
26
     * Reverse the migrations.
27
     */
28
    public function down()
29
    {
30
        Schema::dropIfExists(config('rating.table_name', 'ratings'));
31
    }
32
}
33