Passed
Push — develop ( a95732...cd40df )
by Septianata
12:51
created

anonymous//database/migrations/2021_05_22_000009_create_denominations_table.php$0   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
c 0
b 0
f 0
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A 2021_05_22_000009_create_denominations_table.php$0 ➔ up() 0 13 1
A 2021_05_22_000009_create_denominations_table.php$0 ➔ down() 0 3 1
1
<?php
2
3
use App\Enum\DenominationType;
4
use Illuminate\Database\Migrations\Migration;
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Support\Facades\Schema;
7
8
/**
9
 * @see \App\Models\Denomination
10
 */
11
return new class extends Migration
12
{
13
    /**
14
     * Run the migrations.
15
     *
16
     * @return void
17
     */
18
    public function up()
19
    {
20
        Schema::create('denominations', function (Blueprint $table) {
21
            $table->id();
22
23
            $table->string('name');
24
            $table->decimal('value');
25
            $table->string('type')->comment('Enum of ' . DenominationType::class);
26
            $table->unsignedInteger('quantity_per_bundle');
27
            $table->unsignedInteger('minimum_order_bundle');
28
            $table->unsignedInteger('maximum_order_bundle');
29
            $table->string('image')->nullable();
30
            $table->timestamps();
31
        });
32
    }
33
34
    /**
35
     * Reverse the migrations.
36
     *
37
     * @return void
38
     */
39
    public function down()
40
    {
41
        Schema::dropIfExists('denominations');
42
    }
43
};
44