Passed
Push — dependabot/npm_and_yarn/string... ( b56eb5...bc569b )
by
unknown
45:46 queued 33s
created

ChangeMorphKey   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 2
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class ChangeMorphKey extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::table('pages', function (Blueprint $table) {
12
            $table->renameColumn('collection', 'morph_key');
13
        });
14
15
        Schema::table('modules', function (Blueprint $table) {
16
            $table->renameColumn('collection', 'morph_key');
17
        });
18
19
        Schema::table('pages', function (Blueprint $table) {
20
            $table->string('morph_key', 255)->change();
21
        });
22
23
        Schema::table('modules', function (Blueprint $table) {
24
            $table->string('morph_key', 255)->change();
25
        });
26
    }
27
28
    public function down()
29
    {
30
        Schema::dropIfExists('pagesets');
31
    }
32
}
33