Skip to content

Commit cb54efb

Browse files
authored
Fix allowedTags for postgres
1 parent 47adb84 commit cb54efb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Db/TagMapper.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ public function allowedTags($id, $tag_ids){
6060
foreach ($tag_ids as $t){
6161
if (empty($t))
6262
continue;
63-
$sql = 'insert into `*PREFIX*timetracker_locked_project_allowed_tag` (project_id, tag_id, created_at) values(?,?,UNIX_TIMESTAMP(now())) ';
63+
if ($this->dbengine == 'MYSQL'){
64+
$sql = 'insert into `*PREFIX*timetracker_locked_project_allowed_tag` (project_id, tag_id, created_at) values(?,?,UNIX_TIMESTAMP(now())) ';
65+
} else {
66+
$sql = 'insert into `*PREFIX*timetracker_locked_project_allowed_tag` (project_id, tag_id, created_at) values(?,?,extract(epoch from now())) ';
67+
}
6468
$this->execute($sql, [$id, $t]);
6569
}
6670
return;
6771
}
6872

6973

70-
}
74+
}

0 commit comments

Comments
 (0)