Failed Conditions
Push — master ( 695a80...e85935 )
by Dallas
05:29 queued 02:39
created

CreateTestModelTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
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