-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes related to common issues (#354)
- Loading branch information
1 parent
3cefa9a
commit 6fcacf7
Showing
4 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
rollback; | ||
begin; | ||
|
||
update workspaces | ||
set last_synced_at = ( | ||
select max(case when e.fund_source = 'PERSONAL' then e.created_at end) | ||
from expenses e | ||
where | ||
e.fund_source = 'PERSONAL' | ||
and | ||
e.workspace_id = workspaces.id | ||
group by e.workspace_id | ||
), | ||
ccc_last_synced_at = ( | ||
select max(case when e.fund_source = 'CCC' then e.created_at end) | ||
from expenses e | ||
where | ||
e.fund_source = 'CCC' | ||
and | ||
e.workspace_id = workspaces.id | ||
group by e.workspace_id | ||
) | ||
where workspaces.last_synced_at is null and workspaces.ccc_last_synced_at is null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters