diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-02-20 22:30:01 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-02-20 22:30:01 -0500 |
commit | 3d7a682ec794b7485fc979ca910e22c6438a3c26 (patch) | |
tree | 8ca8af0e50d775e62752a41adabd2a332f408a32 /app/Schema | |
parent | 63a460724dbb3996e4c7c6790b0ec271eb5f99f5 (diff) |
Fix compatibility issue with Mysql migration
Diffstat (limited to 'app/Schema')
-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)); + } } } |