Skip to content

Commit 55a94af

Browse files
Merge pull request #23 from IFRCGo/feature/WN-285
Feature/wn 285
2 parents e2b5699 + a2bde7e commit 55a94af

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class RenameRegionsToSubnational extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::rename('regions', 'subnationals');
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*
22+
* @return void
23+
*/
24+
public function down()
25+
{
26+
27+
Schema::rename('subnationals', 'regions');
28+
29+
}
30+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class ChangeRegionToSubnational extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
DB::table('usage_logs')->update([
17+
'subnational' => DB::raw('region')
18+
]);
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
29+
DB::table('usage_logs')->update([
30+
'region' => DB::raw('subnational')
31+
]);
32+
}
33+
}

0 commit comments

Comments
 (0)