Passed
Push — feature/review_applications ( 18f610...a1a1bf )
by Tristan
08:57
created

ModifyApplicationReviewStatuses::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class ModifyApplicationReviewStatuses extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        DB::table( 'review_statuses')->where('name', 'not_reviewed')->update(['name' => 'screened_out']);
17
        DB::table( 'review_statuses')->where('name', 'partially_reviewed')->update(['name' => 'still_thinking']);
18
        DB::table( 'review_statuses')->where('name', 'reviewed')->update(['name' => 'still_in']);
19
20
        DB::table('review_statuses')->insert([
21
            ['id' => 4, 'name' => 'not_reviewed'],
22
        ]);
23
    }
24
25
    /**
26
     * Reverse the migrations.
27
     *
28
     * @return void
29
     */
30
    public function down()
31
    {
32
        DB::table( 'review_statuses')->where('name', 'not_reviewed')->delete();
33
34
        DB::table('review_statuses')->where('name', 'screened_out')->update(['name' => 'not_reviewed']);
35
        DB::table('review_statuses')->where('name', 'still_thinking')->update(['name' => 'partially_reviewed']);
36
        DB::table('review_statuses')->where('name', 'still_in')->update(['name' => 'reviewed']);
37
    }
38
}
39