Passed
Push — main ( 86a6dd...ec1f24 )
by PRATIK
03:12
created

CreateEventsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 18
nc 1
nop 0
dl 0
loc 20
rs 9.6666
c 1
b 0
f 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateEventsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('events', function (Blueprint $table) {
17
            $table->id();
18
            $table->string('code')->unique();
19
            $table->string('name')->unique();
20
            $table->string('slug')->unique();
21
            $table->longText('description');
22
            $table->boolean('single_day')->default(1);
23
            $table->dateTime('event_date')->nullable();
24
            $table->dateTime('start_date')->nullable();
25
            $table->dateTime('end_date')->nullable();
26
            $table->string('interval')->nullable();
27
            $table->string('notice')->nullable();
28
            $table->string('image')->nullable();
29
            $table->foreignId('gallery_id')->nullable()->constrained()->nullOnDelete();
30
            $table->string('meta_name')->nullable();
31
            $table->string('meta_description')->nullable();
32
            $table->string('meta_keywords')->nullable();
33
            $table->timestamps();
34
        });
35
    }
36
37
    /**
38
     * Reverse the migrations.
39
     *
40
     * @return void
41
     */
42
    public function down()
43
    {
44
        Schema::dropIfExists('events');
45
    }
46
}
47