-
Notifications
You must be signed in to change notification settings - Fork 3
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 * Fixes related to common issues * Decrease cov to 95 from 96 * fix test case * Add missing test case, Increased test coverage
- Loading branch information
1 parent
3302d19
commit b52999a
Showing
6 changed files
with
115 additions
and
14 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
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
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