summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Model/CommentHistory.php2
-rw-r--r--app/Model/SubtaskHistory.php2
-rw-r--r--app/Model/TaskHistory.php2
-rw-r--r--app/Schema/Mysql.php55
-rw-r--r--app/Templates/event_subtask_create.php2
-rw-r--r--app/Templates/event_subtask_update.php2
-rw-r--r--app/common.php3
-rw-r--r--vendor/PicoDb/Schema.php7
8 files changed, 17 insertions, 58 deletions
diff --git a/app/Model/CommentHistory.php b/app/Model/CommentHistory.php
index 5b94729c..5988c026 100644
--- a/app/Model/CommentHistory.php
+++ b/app/Model/CommentHistory.php
@@ -98,7 +98,7 @@ class CommentHistory extends BaseHistory
LEFT JOIN tasks ON tasks.id=comment_has_events.task_id
WHERE comment_has_events.project_id = ?
ORDER BY comment_has_events.id DESC
- LIMIT 0, '.$limit.'
+ LIMIT '.$limit.' OFFSET 0
';
$rq = $this->db->execute($sql, array($project_id));
diff --git a/app/Model/SubtaskHistory.php b/app/Model/SubtaskHistory.php
index bbf6ce3d..89076261 100644
--- a/app/Model/SubtaskHistory.php
+++ b/app/Model/SubtaskHistory.php
@@ -105,7 +105,7 @@ class SubtaskHistory extends BaseHistory
LEFT JOIN users AS assignees ON assignees.id=task_has_subtasks.user_id
WHERE subtask_has_events.project_id = ?
ORDER BY subtask_has_events.id DESC
- LIMIT 0, '.$limit.'
+ LIMIT '.$limit.' OFFSET 0
';
$rq = $this->db->execute($sql, array($project_id));
diff --git a/app/Model/TaskHistory.php b/app/Model/TaskHistory.php
index 35b7cb27..af0b4cff 100644
--- a/app/Model/TaskHistory.php
+++ b/app/Model/TaskHistory.php
@@ -96,7 +96,7 @@ class TaskHistory extends BaseHistory
LEFT JOIN columns ON columns.id=tasks.column_id
WHERE task_has_events.project_id = ?
ORDER BY task_has_events.id DESC
- LIMIT 0, '.$limit.'
+ LIMIT '.$limit.' OFFSET 0
';
$rq = $this->db->execute($sql, array($project_id));
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 9ab12a1a..2d3f993e 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -19,8 +19,9 @@ function version_25($pdo)
data TEXT,
FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
- FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
- );
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,
+ PRIMARY KEY (id)
+ ) ENGINE=InnoDB CHARSET=utf8
");
$pdo->exec("
@@ -36,8 +37,9 @@ function version_25($pdo)
FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE,
- FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
- );
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,
+ PRIMARY KEY (id)
+ ) ENGINE=InnoDB CHARSET=utf8
");
$pdo->exec("
@@ -53,8 +55,9 @@ function version_25($pdo)
FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,
FOREIGN KEY(comment_id) REFERENCES comments(id) ON DELETE CASCADE,
- FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE
- );
+ FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,
+ PRIMARY KEY (id)
+ ) ENGINE=InnoDB CHARSET=utf8
");
}
@@ -197,46 +200,6 @@ function version_12($pdo)
);
}
-function version_11($pdo)
-{
-}
-
-function version_10($pdo)
-{
-}
-
-function version_9($pdo)
-{
-}
-
-function version_8($pdo)
-{
-}
-
-function version_7($pdo)
-{
-}
-
-function version_6($pdo)
-{
-}
-
-function version_5($pdo)
-{
-}
-
-function version_4($pdo)
-{
-}
-
-function version_3($pdo)
-{
-}
-
-function version_2($pdo)
-{
-}
-
function version_1($pdo)
{
$pdo->exec("
diff --git a/app/Templates/event_subtask_create.php b/app/Templates/event_subtask_create.php
index 81268449..9772d807 100644
--- a/app/Templates/event_subtask_create.php
+++ b/app/Templates/event_subtask_create.php
@@ -5,7 +5,7 @@
<em><?= Helper\escape($task_title) ?></em><br/>
<p><?= Helper\escape($subtask_title) ?> <strong>(<?= Helper\in_list($subtask_status, $subtask_status_list) ?>)</strong></p>
<?php if ($subtask_assignee): ?>
- <p><?= t('Assigned to %s with estimate of %s/%sh', $subtask_assignee, $subtask_time_spent, $subtask_time_estimated) ?></p>
+ <p><?= t('Assigned to %s with an estimate of %s/%sh', $subtask_assignee, $subtask_time_spent, $subtask_time_estimated) ?></p>
<?php else: ?>
<p><?= t('Not assigned, estimate of %sh', $subtask_time_estimated) ?></p>
<?php endif ?>
diff --git a/app/Templates/event_subtask_update.php b/app/Templates/event_subtask_update.php
index 9862f997..70f9d76d 100644
--- a/app/Templates/event_subtask_update.php
+++ b/app/Templates/event_subtask_update.php
@@ -5,7 +5,7 @@
<em><?= Helper\escape($task_title) ?></em><br/>
<p><?= Helper\escape($subtask_title) ?> <strong>(<?= Helper\in_list($subtask_status, $subtask_status_list) ?>)</strong></p>
<?php if ($subtask_assignee): ?>
- <p><?= t('Assigned to %s with estimate of %s/%sh', $subtask_assignee, $subtask_time_spent, $subtask_time_estimated) ?></p>
+ <p><?= t('Assigned to %s with an estimate of %s/%sh', $subtask_assignee, $subtask_time_spent, $subtask_time_estimated) ?></p>
<?php else: ?>
<p><?= t('Not assigned, estimate of %sh', $subtask_time_estimated) ?></p>
<?php endif ?>
diff --git a/app/common.php b/app/common.php
index f295ab5f..f46e3c6b 100644
--- a/app/common.php
+++ b/app/common.php
@@ -152,7 +152,8 @@ $registry->db = function() use ($registry) {
return $db;
}
else {
- die('Unable to migrate database schema!');
+ $errors = $db->getLogMessages();
+ die('Unable to migrate database schema: <br/><br/><strong>'.(isset($errors[0]) ? $errors[0] : 'Unknown error').'</strong>');
}
};
diff --git a/vendor/PicoDb/Schema.php b/vendor/PicoDb/Schema.php
index b75366ea..a054ac09 100644
--- a/vendor/PicoDb/Schema.php
+++ b/vendor/PicoDb/Schema.php
@@ -36,20 +36,15 @@ class Schema
$function_name = '\Schema\version_'.$i;
if (function_exists($function_name)) {
-
call_user_func($function_name, $this->db->getConnection());
$this->db->getConnection()->setSchemaVersion($i);
}
- else {
-
- throw new \LogicException('To execute a database migration, you need to create this function: "'.$function_name.'".');
- }
}
$this->db->closeTransaction();
}
catch (\PDOException $e) {
-
+ $this->db->setLogMessage($function_name.' => '.$e->getMessage());
$this->db->cancelTransaction();
return false;
}