Skip to content

Commit a2bde7e

Browse files
committed
update migrations
1 parent b4e9e24 commit a2bde7e

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

database/migrations/2025_03_25_120530_rename_regions_to_subnational.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class RenameRegionsToSubnational extends Migration
1313
*/
1414
public function up()
1515
{
16-
Schema::rename('regions', 'subnational');
16+
Schema::rename('regions', 'subnationals');
1717
}
1818

1919
/**
@@ -24,7 +24,7 @@ public function up()
2424
public function down()
2525
{
2626

27-
Schema::rename('subnational', 'regions');
27+
Schema::rename('subnationals', 'regions');
2828

2929
}
3030
}

database/migrations/2025_03_25_127530_change_region_to_subnational.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ class ChangeRegionToSubnational extends Migration
1313
*/
1414
public function up()
1515
{
16-
Schema::table('usage_logs', function (Blueprint $table) {
17-
$table->string('subnational', 45)->nullable()->change();
18-
});
16+
DB::table('usage_logs')->update([
17+
'subnational' => DB::raw('region')
18+
]);
1919
}
2020

2121
/**
@@ -25,8 +25,9 @@ public function up()
2525
*/
2626
public function down()
2727
{
28-
Schema::table('usage_logs', function (Blueprint $table) {
29-
$table->string('region', 45)->nullable()->change();
30-
});
28+
29+
DB::table('usage_logs')->update([
30+
'region' => DB::raw('subnational')
31+
]);
3132
}
3233
}

0 commit comments

Comments
 (0)