-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #665 from wri/main
[MERGE] main -> staging post WW release.
- Loading branch information
Showing
13 changed files
with
221 additions
and
31 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
app/Console/Commands/OneOff/SetDefaultConditionalValuesForFormQuestions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands\OneOff; | ||
|
||
use App\Models\V2\Forms\FormQuestion; | ||
use Illuminate\Console\Command; | ||
|
||
class SetDefaultConditionalValuesForFormQuestions extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'one-off:set-default-conditional-values-for-form-questions'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Sets a default value for conditional values in form questions'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
FormQuestion::whereIn('id', [ | ||
875,878,880,900,907,981,985,1001,1088,1089,1090,1097,1103,1104,1105,1118,1180,1216,1219,1274,1275,1291,1295,1311,1520,1540,1605,1625,1705,1707,1709,1727,1795,1815,1845,1846,1860,1878,1891,1900,1931,1935,1951,1963,1965,2990,2994,3010,3022,3024,3051,3055,3071,3083,3085,3105,3106,3384,3386,3388,3398,3400,3406,3408,3410,3420,3422,3443,3470,3472,3474,3484,3486, | ||
])->each(function (FormQuestion $formQuestion): void { | ||
$formQuestion->children()->update(['is_parent_conditional_default' => true]); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
database/migrations/2025_01_21_184458_add_conditional_default_to_form_questions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('form_questions', function (Blueprint $table) { | ||
$table->boolean('conditional_default')->default(true); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('form_questions', function (Blueprint $table) { | ||
$table->dropColumn('conditional_default'); | ||
}); | ||
} | ||
}; |
27 changes: 27 additions & 0 deletions
27
database/migrations/2025_01_23_163905_add_is_parent_conditional_default_value.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('form_questions', function (Blueprint $table) { | ||
$table->boolean('is_parent_conditional_default')->default(false); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('form_questions', function (Blueprint $table) { | ||
$table->dropColumn('is_parent_conditional_default'); | ||
}); | ||
} | ||
}; |
Oops, something went wrong.