diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-06-19 21:54:12 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-06-19 21:54:12 -0400 |
commit | 418f5522a2edf3c30d0b090634c4b33e2d2930e6 (patch) | |
tree | cb2ddb7735b65ab2b54291bb83e019d6c9714093 /app | |
parent | 25b8961632cda34ea9b7bc36d3c746ed12a87f0b (diff) |
Improve SQL migrations when old default swimlanes have the same name as a normal swimlanes
Diffstat (limited to 'app')
-rw-r--r-- | app/Schema/Migration.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Schema/Migration.php b/app/Schema/Migration.php index 654303f4..21ef4427 100644 --- a/app/Schema/Migration.php +++ b/app/Schema/Migration.php @@ -13,6 +13,13 @@ function migrate_default_swimlane(PDO $pdo) $project['default_swimlane'] = 'Default swimlane'; } + $rq = $pdo->prepare('SELECT 1 FROM swimlanes WHERE name=? AND project_id=?'); + $rq->execute(array($project['default_swimlane'], $project['id'])); + + if ($rq->fetchColumn()) { + $project['default_swimlane'] = $project['default_swimlane'].' (Default swimlane)'; + } + // Create new default swimlane $rq = $pdo->prepare('INSERT INTO swimlanes (project_id, name, is_active, position) VALUES (?, ?, ?, ?)'); $rq->execute(array( |