AddStandardRssFields   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 50
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
A down() 0 21 1
1
<?php
2
3
namespace CosmicRadioTV\Podcast\Updates;
4
5
use DB;
6
use Illuminate\Database\Schema\Blueprint;
7
use October\Rain\Database\Updates\Migration;
8
use Schema;
9
10
class AddStandardRssFields extends Migration
11
{
12
13
    /**
14
     * Migration
15
     */
16
    public function up()
17
    {
18
        DB::transaction(function () {
19
            Schema::table('cosmicradiotv_podcast_shows', function (Blueprint $table) {
20
                $table->string('feed_language')->default('en-us')->after('description');
21
                $table->string('feed_copyright')->nullable()->after('feed_language');
22
                $table->string('feed_author')->nullable()->after('feed_copyright');
23
                $table->text('itunes_category')->nullable()->after('feed_author');
24
                $table->boolean('itunes_explicit')->nullable()->after('itunes_category');
25
                $table->string('itunes_owner_name')->nullable()->after('itunes_explicit');
26
                $table->string('itunes_owner_email')->nullable()->after('itunes_owner_name');
27
            });
28
            Schema::table('cosmicradiotv_podcast_episodes', function (Blueprint $table) {
29
                $table->boolean('itunes_explicit')->nullable()->after('published');
30
            });
31
        });
32
    }
33
34
    /**
35
     * Rollback
36
     */
37
    public function down()
38
    {
39
        DB::transaction(function () {
40
            Schema::table('cosmicradiotv_podcast_shows', function (Blueprint $table) {
41
                $table->dropColumn([
42
                    'feed_language',
43
                    'feed_copyright',
44
                    'feed_author',
45
                    'itunes_category',
46
                    'itunes_explicit',
47
                    'itunes_owner_name',
48
                    'itunes_owner_email',
49
                ]);
50
            });
51
            Schema::table('cosmicradiotv_podcast_episodes', function (Blueprint $table) {
52
                $table->dropColumn([
53
                    'itunes_explicit',
54
                ]);
55
            });
56
        });
57
    }
58
59
}