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
|
|
|
|