Completed
Push — main ( a102d3...f9c7f4 )
by Emmanuel
03:55
created

CreateTicketsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 23 1
A down() 0 4 1
1
<?php
2
3
4
/**
5
 * Author: Emmanuel Paul Mnzava
6
 * Twitter: @epmnzava
7
 * Github:https://github.com/dbrax/eticket
8
 * Email: [email protected]
9
 * 
10
 */
11
12
use Illuminate\Support\Facades\Schema;
13
use Illuminate\Database\Schema\Blueprint;
14
use Illuminate\Database\Migrations\Migration;
15
16
class CreateTicketsTable extends Migration
17
{
18
    /**
19
     * Run the migrations.
20
     *
21
     * @return void
22
     */
23
    public function up()
24
    {
25
        Schema::create('tickets', function (Blueprint $table) {
26
            $table->bigIncrements('id');
27
28
              //if the user has loggin you can save the user id
29
            $table->integer('eventid')->nullable();
30
            $table->foreignId('eventid')
31
            ->constrained()
32
            ->onUpdate('cascade')
33
            ->onDelete('cascade');
34
            $table->string('name');
35
            $table->integer('amount');
36
            $table->integer('quantity');
37
            $table->text('description')->nullable();
38
            $table->text('status')->nullable();
39
            $table->integer('minimum_order')->default(1);
40
            $table->integer('maximum_order')->default(1);
41
            $table->integer('hide_on_sold_out')->default(1);
42
            $table->integer('show_quantity_remaining')->default(1);
43
            $table->timestamps();
44
        });
45
    }
46
47
    /**
48
     * Reverse the migrations.
49
     *
50
     * @return void
51
     */
52
    public function down()
53
    {
54
        Schema::dropIfExists('tickets');
55
    }
56
}
57