CreateBlogEtcUploadedPhotosTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 13
dl 0
loc 31
rs 10
c 2
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 6 1
A up() 0 14 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
/**
8
 * Class CreateBlogEtcUploadedPhotosTable.
9
 */
10
class CreateBlogEtcUploadedPhotosTable extends Migration
11
{
12
    /**
13
     * Create the DB table for Blog Etc photos.
14
     */
15
    public function up(): void
16
    {
17
        Schema::create('blog_etc_uploaded_photos', static function (Blueprint $table) {
18
            $table->increments('id');
19
            $table->text('uploaded_images')->nullable();
20
            $table->string('image_title')->nullable();
21
            $table->string('source')->default('unknown');
22
            $table->unsignedInteger('uploader_id')->nullable()->index();
23
24
            $table->timestamps();
25
        });
26
27
        Schema::table('blog_etc_posts', static function (Blueprint $table) {
28
            $table->string('seo_title')->nullable();
29
        });
30
    }
31
32
    /**
33
     * Reverse the migrations.
34
     */
35
    public function down(): void
36
    {
37
        Schema::dropIfExists('blog_etc_uploaded_photos');
38
39
        Schema::table('blog_etc_posts', static function (Blueprint $table) {
40
            $table->dropColumn('seo_title');
41
        });
42
    }
43
}
44