CreateEventsTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 18
nc 1
nop 0
dl 0
loc 25
rs 9.6666
c 1
b 0
f 0
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('id');
18
19
            $table->foreignId('event_category_id')->constrained();
20
            $table->foreignId('venue_id')->constrained();
21
            $table->foreignId('user_id')->constrained();
22
            $table->boolean('is_published')->default(0);
23
24
            $table->string('title');
25
            $table->text('description');
26
            $table->string('contact_email')->nullable();
27
            $table->string('website_event_link')->nullable();
28
            $table->string('facebook_event_link')->nullable();
29
30
            $table->integer('repeat_type');
31
            $table->dateTime('repeat_until')->nullable();
32
            $table->string('repeat_weekly_on')->nullable();
33
            $table->string('on_monthly_kind')->nullable();
34
            $table->text('multiple_dates')->nullable();
35
36
            $table->string('slug');
37
38
            $table->timestamps();
39
        });
40
    }
41
42
    /**
43
     * Reverse the migrations.
44
     *
45
     * @return void
46
     */
47
    public function down()
48
    {
49
        Schema::dropIfExists('events');
50
    }
51
}
52