summaryrefslogtreecommitdiff
path: root/internal/database
diff options
context:
space:
mode:
Diffstat (limited to 'internal/database')
-rw-r--r--internal/database/queries.sql18
1 files changed, 5 insertions, 13 deletions
diff --git a/internal/database/queries.sql b/internal/database/queries.sql
index 8eda5f4..969119a 100644
--- a/internal/database/queries.sql
+++ b/internal/database/queries.sql
@@ -25,11 +25,7 @@ values (
@description,
@client_id,
@project_id,
- coalesce(
- @billable_rate,
- (select p.billable_rate from project p where p.id = @project_id),
- (select c.billable_rate from client c where c.id = @client_id)
- )
+ @billable_rate
)
returning *;
@@ -127,16 +123,12 @@ values (
@description,
@client_id,
@project_id,
- coalesce(
- @billable_rate,
- (select p.billable_rate from project p where p.id = @project_id),
- (select c.billable_rate from client c where c.id = @client_id)
- )
+ @billable_rate
)
returning *;
-- name: GetInvoiceDataByClient :many
-select
+select
te.id as time_entry_id,
te.start_time,
te.end_time,
@@ -321,8 +313,8 @@ where id = (
-- name: EditTimeEntry :exec
update time_entry
set
- start_time = @start_time,
- end_time = @end_time,
+ start_time = datetime(@start_time),
+ end_time = datetime(@end_time),
description = @description,
client_id = @client_id,
project_id = @project_id,