From 6e088f97c6a0439c4922185e56de79056a7792d1 Mon Sep 17 00:00:00 2001 From: Nathan Curtis Date: Thu, 14 Nov 2024 15:26:52 -0800 Subject: [PATCH] [TM-1469] Backfill test projects and orgs. --- .../OneOff/BackfillTestProjectsOrgs.php | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 app/Console/Commands/OneOff/BackfillTestProjectsOrgs.php diff --git a/app/Console/Commands/OneOff/BackfillTestProjectsOrgs.php b/app/Console/Commands/OneOff/BackfillTestProjectsOrgs.php new file mode 100644 index 000000000..f99b88304 --- /dev/null +++ b/app/Console/Commands/OneOff/BackfillTestProjectsOrgs.php @@ -0,0 +1,56 @@ +get() as $organisation) { + $organisation->update(['is_test' => true]); + + foreach ($organisation->projects as $project) { + $project->update(['is_test' => true]); + } + } + + foreach (Project::whereIn('uuid', self::TEST_PROJECTS)->get() as $project) { + $project->update(['is_test' => true]); + } + } +}