CreateShowsTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace CosmicRadioTV\Podcast\Updates;
4
5
use DB;
6
use Illuminate\Database\Schema\Blueprint;
7
use Schema;
8
use October\Rain\Database\Updates\Migration;
9
10
class CreateShowsTable extends Migration
11
{
12
13
    /**
14
     * Migration
15
     */
16
    public function up()
17
    {
18 View Code Duplication
        DB::transaction(function () {
19
            Schema::create('cosmicradiotv_podcast_shows', function (Blueprint $table) {
20
                $table->engine = 'InnoDB';
21
                $table->increments('id');
22
                $table->string('name');
23
                $table->string('slug');
24
                $table->text('description')->nullable();
25
                $table->timestamps();
26
27
                $table->unique('slug');
28
            });
29
        });
30
    }
31
32
    /**
33
     * Rollback
34
     */
35
    public function down()
36
    {
37
        DB::transaction(function () {
38
            Schema::drop('cosmicradiotv_podcast_shows');
39
        });
40
    }
41
}