diff options
Diffstat (limited to 'app/Schema/Migration.php')
-rw-r--r-- | app/Schema/Migration.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/Schema/Migration.php b/app/Schema/Migration.php index 395ac1ad..91838efa 100644 --- a/app/Schema/Migration.php +++ b/app/Schema/Migration.php @@ -38,8 +38,15 @@ function migrate_default_swimlane(PDO $pdo) )); // Migrate automatic actions - $rq = $pdo->prepare("UPDATE action_has_params SET value=? WHERE id IN (SELECT action_has_params.id FROM action_has_params LEFT JOIN actions ON actions.id=action_has_params.action_id WHERE project_id=? AND name='swimlane_id' AND value='0')"); - $rq->execute(array($swimlaneId, $project['id'])); + $rq = $pdo->prepare("SELECT action_has_params.id FROM action_has_params LEFT JOIN actions ON actions.id=action_has_params.action_id WHERE project_id=? AND name='swimlane_id' AND value='0'"); + $rq->execute(array($project['id'])); + $ids = $rq->fetchAll(PDO::FETCH_COLUMN, 0); + + $rq = $pdo->prepare("UPDATE action_has_params SET value=? WHERE id=?"); + + foreach ($ids as $id) { + $rq->execute(array($swimlaneId, $id)); + } } } |