-
Notifications
You must be signed in to change notification settings - Fork 19
Filter games version 3 #1199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alice-blue
wants to merge
85
commits into
iftechfoundation:main
Choose a base branch
from
alice-blue:filter-games-version-3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Filter games version 3 #1199
Changes from 78 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
c33d887
incoming-schema-changes.sql: Add game_filter column to users table
alice-blue 15dd836
editprofile: add game filter section to settings page
alice-blue 483be87
Update searchutil.php to handle custom game filters
alice-blue 6ec9ad0
Update search page to handle custom filters
alice-blue e0198ef
Update ifdb-recommends.php to handle custom game filters
alice-blue d6421d7
Misc fixes
alice-blue 84ec727
Revise message to make it clear that results were actually filtered
alice-blue 6b05a60
Make a function to generate the "games were filtered" message since i…
alice-blue a0f8cbf
newitems.php: Modify getNewItems function to deal with game filters
alice-blue 5cfbedb
allnew: show "games were filtered" message
alice-blue 9066155
searchutil.php: revise the games filtered announcement function so th…
alice-blue 9fd2143
search: use new parameters for filtered game message function
alice-blue afb1b7d
home: add $game_filter_was_applied
alice-blue d5e78b5
Update competitions.php: add $game_filter_was_applied
alice-blue 1b15649
Update recommended-lists.php: add $game_filter_was_applied
alice-blue 7740129
Update reviews.php: add $game_filter_was_applied
alice-blue dc02597
games.php: add $game_filter_was_applied
alice-blue 08b3e2b
allnew: Remember if we're overriding the game filter when going to an…
alice-blue acfc5b2
search: When we go to the next page of results, remember if we're ov…
alice-blue 6768a79
searchutil.php: Avoid implying that results were hidden, since we don…
alice-blue 89abff7
searchutil.php: the --> that
alice-blue 61fbf4c
add lastReviewDate column to gameRatingsSandbox0_mv
alice-blue 5b7854f
add lastreviewdate to line 430
alice-blue ee2c725
compute the maximum lastReviewDate of all of the grouped rows where h…
alice-blue 235cde7
game id for testing
alice-blue e30b238
comment out specific game that we were testing
alice-blue 5afce90
lastReviewDate --> lastRatingDate
alice-blue e81351f
lastRatingDate --> lastRatingOrReviewDate
alice-blue 1c43e30
put lastReviewDate in all the right places
alice-blue 86352e0
; --> ,
alice-blue f6d9984
+ key
alice-blue 5753fb8
trying to sort by the lastReview column
alice-blue b2dfe67
remove lines for specific game being tested
alice-blue f6276fb
limit to 100 resuults
alice-blue a55a0ed
Update comments
alice-blue 255a5df
oops, $limit should be a clause
alice-blue fe0e521
unscrub-ifarchive.sql: tinyint --> datetime
alice-blue 207acf6
add "lastreview:" search prefix
alice-blue b0de404
newitems.php: Add "lastReviewDate:90d-" to search term when looking f…
alice-blue a6d0fcd
newitems: when fetching reviews and a filter is applied, look for gam…
alice-blue 9519782
revise comments
alice-blue 2449900
misc fixes
alice-blue 69c1c3a
explain "lastreview:" in the comments
alice-blue d0f1a38
comment
alice-blue 52c172b
Merge branch 'main' into filter-games-version-3
alice-blue 157bf5f
searchutil.php: Add $count_all_possible_rows parameter to doSearch
alice-blue 310ebac
ifdb-recommends.php: Use $count_all_possible_rows parameter in call t…
alice-blue be1f667
review: Use $count_all_possible_rows parameter and $override_game_fil…
alice-blue 0954a8b
search: Use $count_all_possible_rows parameter in call to doSearch
alice-blue db7086a
editgame: Use $count_all_possible_rows and $override_game_filter para…
alice-blue 9bc40d4
length($rows) --> count($rows) (to get rid of fatal error)
alice-blue 166f2f6
$where --> !$term
alice-blue b571fc5
Combine conditions & comments
alice-blue 8796aec
Merge branch 'main' into doSearch-need_total_rows-parameter
alice-blue f3d6803
Merge branch 'main' into filter-games-merged
dfabulich 663cef4
Merge branch 'ifdb-recommends-performance' into filter-games-merged
dfabulich 30cc954
Merge branch 'use-doSearch-for-newitems' into filter-games-merged
dfabulich 07c67d6
Merge pull request #9 from dfabulich/filter-games-merged
alice-blue 319a01e
searchutil.php: remove redundant lines
alice-blue 9ce96d2
editprofile: update description of game filtering to say it applies t…
alice-blue 1003e84
newitems.php: leave out the last review date limit if we need 20+ rev…
alice-blue 4510639
use clearer variable to accomplish the same effect
alice-blue 7f4e701
Mention that this applies to the "New Reviews on IFDB" page
alice-blue a32141f
Merge branch 'main' into filter-games-version-3
dfabulich 37a1f48
Always search games to find new reviews
dfabulich b29b7ea
Merge branch 'searchutil-inner-join-gameratings' into always-search-g…
dfabulich 41094c4
newitems.php: get $game_filter_was_applied from doSearch
alice-blue e9974e7
Update newitems.php
alice-blue c521685
Merge pull request #10 from dfabulich/always-search-games-for-new-rev…
alice-blue daef845
Add `lastReviewDate` to `gameRatingsSandbox01`
dfabulich 8d207a2
Patch full schema
dfabulich 299d173
Merge pull request #11 from dfabulich/sandboxed-lastReviewDate
alice-blue 2c2c481
Merge pull request #12 from dfabulich/filter-games-patch-full-schema
alice-blue b449361
Merge branch 'main' into filter-games-version-3
alice-blue bf96322
Fix `refresh_gameRatingsSandbox0_mv` stored procedure
dfabulich fdd17d4
Merge pull request #13 from dfabulich/fix-mv-last-review-date
alice-blue f5250d3
Remove "lastreview" search prefix from searchutil.php
alice-blue 9e4b42b
Add view and materialized view to track recent game news
alice-blue 4c3d00c
Exclude deleted news items
alice-blue 8934fb5
Add key (game_id) to recentgamenews materialized view
alice-blue 069f447
gametimes --> recentgamenews
alice-blue 5690ec5
Add a recent_game_news sorting option to the $sortList in searchutil.…
alice-blue c7c7b51
Explain what A means
alice-blue 8d7c167
newitems.php: In the game news query, limit results to games that mat…
alice-blue d8d8dcb
newitems.php: Change recentgamenews_mv.game_id to g.id
alice-blue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,107 @@ | ||
| USE ifdb; | ||
|
|
||
| -- use this script for pending changes to the production DB schema | ||
|
|
||
|
|
||
|
|
||
| -- Add column for game search filter to the users table | ||
|
|
||
| ALTER TABLE `users` ADD COLUMN `game_filter` VARCHAR(150) DEFAULT ''; | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| -- Add a view to track the news items for each game. | ||
| -- "G" in the news table means the news is about a game. | ||
| -- Do not include versions of news items that have been | ||
| -- superseded by later edits. | ||
|
|
||
| CREATE VIEW `recentgamenews` AS | ||
| SELECT | ||
| newsid AS news_id, | ||
| sourceid AS game_id, | ||
| created AS news_create_date | ||
| FROM news | ||
| WHERE source = "G" | ||
| AND newsid NOT IN ( | ||
| SELECT supersedes | ||
| FROM news | ||
| WHERE supersedes IS NOT NULL | ||
| ) | ||
| ORDER BY news_id DESC; | ||
|
|
||
|
|
||
|
|
||
| -- Create a materialized view to store the data from the recentgamenews view | ||
|
|
||
| CREATE TABLE recentgamenews_mv ( | ||
| news_id BIGINT(20) unsigned NOT NULL, | ||
| game_id VARCHAR(32) NOT NULL, | ||
| news_create_date DATETIME NOT NULL, | ||
| PRIMARY KEY (news_id) | ||
alice-blue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ); | ||
|
|
||
|
|
||
|
|
||
| -- Populate the recentgamenews_mv materialized view from the recentgamenews view | ||
|
|
||
| lock tables recentgamenews_mv write, recentgamenews read; | ||
| truncate table recentgamenews_mv; | ||
| insert into recentgamenews_mv select * from recentgamenews; | ||
| unlock tables; | ||
|
|
||
|
|
||
|
|
||
| -- Procedure to update one row of the recentgamenews_mv materialized view | ||
|
|
||
| DROP PROCEDURE IF EXISTS refresh_recentgamenews_mv; | ||
| DELIMITER $$ | ||
|
|
||
| CREATE PROCEDURE refresh_recentgamenews_mv ( | ||
| IN new_newsid BIGINT(20) | ||
| ) | ||
| BEGIN | ||
| select * | ||
| from recentgamenews | ||
| where news_id = new_newsid | ||
| into @news_id, | ||
| @game_id, | ||
| @news_create_date; | ||
| if @news_id is null then | ||
| delete from recentgamenews_mv where news_id = new_news_id; | ||
| else | ||
| insert into recentgamenews_mv | ||
| values ( | ||
| @news_id, | ||
| @game_id, | ||
| @news_create_date | ||
| ) on duplicate key | ||
| update news_id = @news_id, | ||
| game_id = @game_id, | ||
| news_create_date = @news_create_date; | ||
| END IF; | ||
| END; | ||
| $$ | ||
|
|
||
| DELIMITER ; | ||
|
|
||
|
|
||
|
|
||
| -- Create triggers so that when a news item for a game is added to the news table, | ||
| -- the latest news date and the latest news id for that game will automatically | ||
| -- be updated in the recentgamenews_mv materialized view. [Question: How do I limit this to just game news?] | ||
|
|
||
| CREATE TRIGGER recentgamenews_insert | ||
| AFTER INSERT ON news FOR EACH ROW | ||
| call refresh_recentgamenews_mv(NEW.newsid); | ||
|
|
||
|
|
||
| CREATE TRIGGER recentgamenews_update | ||
| AFTER UPDATE ON news FOR EACH ROW | ||
| call refresh_gametimes_mv(NEW.newsid); | ||
alice-blue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| CREATE TRIGGER recentgamenews_delete | ||
| AFTER DELETE ON news FOR EACH ROW | ||
| call refresh_recentgamenews_mv(OLD.newsid); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.