-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve speed of index page rendering with tags
- Loading branch information
Showing
3 changed files
with
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Sequel.migration do | ||
change do | ||
|
||
# This view includes all the latest pacts, as well as the latest pacts | ||
# for each tag. | ||
# If a pact publication is the latest AND the latest tagged version | ||
# there will be two rows in this view for it - one for the top | ||
# query,and one for the bottom. | ||
create_view(:head_pact_publications, | ||
"select lp.*, null as tag_name, 1 as latest | ||
from latest_pact_publications lp | ||
UNION | ||
select ltp.*, null as latest | ||
from latest_tagged_pact_publications ltp | ||
" | ||
) | ||
|
||
end | ||
end |
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