Completed
Push — dev ( f4c322...6b8a62 )
by Tristan
06:37
created

PopulateLanguageRequirementsEnOrFr   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 4 1
A up() 0 9 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 PopulateLanguageRequirementsEnOrFr extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        DB::table('language_requirements')->insert([
17
            ['id' => 4, 'name' => 'english_or_french'],
18
        ]);
19
20
        DB::table('language_requirement_translations')->insert([
21
            ['id' => 7, 'language_requirement_id' => 4, 'locale' => 'en', 'value' => 'English or French'],
22
            ['id' => 8, 'language_requirement_id' => 4, 'locale' => 'fr', 'value' => 'Anglais ou Français'],
23
        ]);
24
    }
25
26
    /**
27
     * Reverse the migrations.
28
     *
29
     * @return void
30
     */
31
    public function down()
32
    {
33
        DB::table('language_requirements')->whereIn('id', [4])->delete();
34
        DB::table('language_requirement_translations')->whereIn('id', [7, 8])->delete();
35
    }
36
}
37