CreateMyriadOrderPackagesTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 42
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 24 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 CreateMyriadOrderPackagesTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create(config('myriad-data-store.tables.order_packages'), function (Blueprint $table) {
17
            $table->id();
18
            $table->unsignedBigInteger('order_id');
19
            $table->unsignedBigInteger('order_package_type_id')->index();
20
            $table->unsignedBigInteger('title_id')->index();
21
            $table->string('start_issue')->index();
22
            $table->string('end_issue')->index();
23
            $table->string('status')->index();
24
            $table->string('stopcode')->index();
25
            $table->unsignedBigInteger('myriad_package_id')->nullable()->index();
26
            $table->unsignedBigInteger('remaining_issues')->index();
27
            $table->unsignedBigInteger('copies')->index();
28
            $table->json('details')->nullable();
29
            $table->date('end_issue_dn')->nullable()->index();
30
            $table->date('start_issue_dn')->nullable()->index();
31
            $table->timestamps();
32
33
            $table->foreign('order_id')
34
                  ->references('id')
35
                  ->on(config('myriad-data-store.tables.orders'))
36
                  ->onUpdate('cascade')
37
                  ->onDelete('cascade');
38
        });
39
    }
40
41
    /**
42
     * Reverse the migrations.
43
     *
44
     * @return void
45
     */
46
    public function down()
47
    {
48
        Schema::dropIfExists(config('myriad-data-store.tables.order_packages'));
49
    }
50
}
51