Skip to content

Commit

Permalink
[TM-1531] change created_by type, change to is_acknowledge
Browse files Browse the repository at this point in the history
  • Loading branch information
egrojMonroy committed Dec 10, 2024
1 parent 986a0a5 commit a367e99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function clipOverlappingPolygonsBySite(string $uuid)
'created_by' => $user->id,
'entity_id' => $site->id,
'entity_type' => get_class($site),
'is_acknowledged' => false
'is_acknowledged' => false,
]);
$job = new FixPolygonOverlapJob($delayedJob->id, $polygonUuids, $user->id);
dispatch($job);
Expand Down Expand Up @@ -88,7 +88,7 @@ public function clipOverlappingPolygonsOfProjectBySite(string $uuid)
'entity_id' => $sitePolygon->id,
'entity_type' => get_class($sitePolygon),
'created_by' => $user->id,
'is_acknowledged' => false
'is_acknowledged' => false,
]);
$job = new FixPolygonOverlapJob($delayedJob->id, $uniquePolygonUuids, $user->id);
dispatch($job);
Expand Down Expand Up @@ -147,7 +147,7 @@ public function clipOverlappingPolygons(Request $request)
'entity_id' => $entity->id,
'entity_type' => get_class($entity),
'created_by' => $user->id,
'is_acknowledged' => false
'is_acknowledged' => false,
]);
$job = new FixPolygonOverlapJob($delayedJob->id, $polygonUuids, $user->id);
dispatch($job);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function ($attribute, $value, $fail) {
'created_by' => $user->id,
'entity_id' => $entity->id,
'entity_type' => get_class($entity),
'is_acknowledged' => false
'is_acknowledged' => false,
]);

$job = new InsertGeojsonToDBJob(
Expand Down Expand Up @@ -411,7 +411,7 @@ public function uploadShapefile(Request $request)
'created_by' => $user->id,
'entity_id' => $entity->id,
'entity_type' => get_class($entity),
'is_acknowledged' => false
'is_acknowledged' => false,
]);

$job = new InsertGeojsonToDBJob(
Expand Down Expand Up @@ -638,7 +638,7 @@ public function uploadGeoJSONFile(Request $request)
'created_by' => $user->id,
'entity_id' => $entity->id,
'entity_type' => get_class($entity),
'is_acknowledged' => false
'is_acknowledged' => false,
]);

$job = new InsertGeojsonToDBJob(
Expand Down Expand Up @@ -1250,7 +1250,7 @@ public function runSiteValidationPolygon(Request $request)
'created_by' => $user->id,
'entity_id' => $entity->id,
'entity_type' => get_class($entity),
'is_acknowledged' => false
'is_acknowledged' => false,
]);
$job = new RunSitePolygonsValidationJob($delayedJob->id, $sitePolygonsUuids);
dispatch($job);
Expand Down Expand Up @@ -1279,7 +1279,7 @@ public function runPolygonsValidation(Request $request)
'created_by' => $user->id,
'entity_id' => $entity->id,
'entity_type' => get_class($entity),
'is_acknowledged' => false
'is_acknowledged' => false,
]);
$job = new RunSitePolygonsValidationJob($delayedJob->id, $uuids);
dispatch($job);
Expand Down
18 changes: 11 additions & 7 deletions database/migrations/2024_12_09_212253_change_is_cleared_values.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
public function up(): void
{
Schema::table('delayed_jobs', function (Blueprint $table) {
if (Schema::hasColumn('delayed_jobs', 'is_cleared')) {
$table->dropColumn('is_cleared');
}
if (!Schema::hasColumn('delayed_jobs', 'is_acknowledged')) {
$table->boolean('is_acknowledged')->default(true);
}
$table->unsignedBigInteger('created_by')->nullable()->change();

$table->dropColumn('is_cleared');

$table->boolean('is_acknowledged')->default(true);
});
}

Expand All @@ -26,10 +25,15 @@ public function up(): void
public function down(): void
{
Schema::table('delayed_jobs', function (Blueprint $table) {
if (Schema::hasColumn('delayed_jobs', 'createdBy')) {
$table->string('createdBy')->nullable()->change();
}

if (Schema::hasColumn('delayed_jobs', 'is_acknowledged')) {
$table->dropColumn('is_acknowledged');
}
if (!Schema::hasColumn('delayed_jobs', 'is_cleared')) {

if (! Schema::hasColumn('delayed_jobs', 'is_cleared')) {
$table->boolean('is_cleared')->default(false);
}
});
Expand Down

0 comments on commit a367e99

Please sign in to comment.