CreateQuizzesTable::up()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 12
rs 9.9666
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreateQuizzesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        if (Schema::hasTable('quizzes')) return;
17
        
18
        Schema::create('quizzes', function (Blueprint $table) {
19
            $table->increments('id');
20
            $table->string('quiz_name', 80);
21
            $table->text('quiz_description');
22
            $table->string('quiz_pin');
23
            $table->enum('active', [0, 1])->nullable();
24
            $table->bigInteger('total_plays')->nullable();
25
            $table->timestamps();
26
        });
27
    }
28
29
    /**
30
     * Reverse the migrations.
31
     *
32
     * @return void
33
     */
34
    public function down()
35
    {
36
        Schema::dropIfExists('quizzes');
37
    }
38
}
39