Failed Conditions
Push — tests ( e631c9...5e06d8 )
by Dallas
03:53
created

CreateTestModelTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 16 1
A down() 0 5 1
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\DB;
8
use Illuminate\Support\Facades\Schema;
9
10
class CreateTestModelTable extends Migration
11
{
12
    public function up()
13
    {
14
        DB::transaction(function () {
15
            Schema::create('test_models', function (Blueprint $table) {
16
                $table->increments('id');
17
18
                $table->string('name');
19
                $table->string('some_field');
20
                $table->float('version')->default(0.0);
21
            });
22
23
            Schema::create('soft_test_models', function (Blueprint $table) {
24
                $table->increments('id');
25
                $table->softDeletes();
26
27
                $table->string('name');
28
            });
29
        });
30
    }
31
32
    public function down()
33
    {
34
        DB::transaction(function () {
35
            Schema::drop('test_models');
36
            Schema::drop('soft_test_models');
37
        });
38
    }
39
}
40