Skip to content

Commit

Permalink
fix: #249 correct invoker id for deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Nov 2, 2024
1 parent bf725e8 commit 5a5f248
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use App\Models\NodeTaskGroupType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Expand All @@ -18,13 +17,12 @@ public function up(): void

$query = <<<'SQL'
UPDATE deployments d
SET configured_by_id = ntg.invoker_id
FROM deployment_node_task_group dntg
INNER JOIN node_task_groups ntg ON ntg.id = dntg.node_task_group_id
WHERE dntg.deployment_id = d.id AND ntg.type IN (?, ?, ?)
SET configured_by_id = t.user_id
FROM teams t
WHERE t.id = d.team_id
SQL;

DB::update($query, [NodeTaskGroupType::LaunchService->value, NodeTaskGroupType::CreateService->value, NodeTaskGroupType::UpdateService->value]);
DB::update($query);
}

/**
Expand Down

0 comments on commit 5a5f248

Please sign in to comment.