Completed
Push — master ( 52970f...c6d773 )
by Tristan
24:57 queued 10:40
created

PopulateCriteriaTypes   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
eloc 11
c 3
b 0
f 1
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 4 1
A up() 0 12 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class PopulateCriteriaTypes extends Migration
8
{
9
    /**
10
    * Run the migrations.
11
    *
12
    * @return void
13
    */
14
    public function up()
15
    {
16
        DB::table('criteria_types')->insert([
17
            ['id' => 1, 'name' => 'essential'],
18
            ['id' => 2, 'name' => 'asset'],
19
        ]);
20
21
        DB::table('criteria_type_translations')->insert([
22
            ['id' => 1, 'criteria_type_id' => 1, 'locale' => 'en', 'value' => 'Need to Have', 'description' => ''],
23
            ['id' => 2, 'criteria_type_id' => 1, 'locale' => 'fr', 'value' => 'Qualifications essentielles', 'description' => ''],
24
            ['id' => 3, 'criteria_type_id' => 2, 'locale' => 'en', 'value' => 'Nice to Have', 'description' => ''],
25
            ['id' => 4, 'criteria_type_id' => 2, 'locale' => 'fr', 'value' => 'Qualifications constituant un atout', 'description' => ''],
26
        ]);
27
    }
28
29
    /**
30
    * Reverse the migrations.
31
    *
32
    * @return void
33
    */
34
    public function down()
35
    {
36
        DB::table('criteria_types')->whereIn('id', [1, 2])->delete();
37
        DB::table('criteria_type_translations')->whereIn('id', [1, 2, 3, 4])->delete();
38
    }
39
}
40