Skip to content
Open
Show file tree
Hide file tree
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 Dec 4, 2024
15dd836
editprofile: add game filter section to settings page
alice-blue Dec 4, 2024
483be87
Update searchutil.php to handle custom game filters
alice-blue Dec 4, 2024
6ec9ad0
Update search page to handle custom filters
alice-blue Dec 4, 2024
e0198ef
Update ifdb-recommends.php to handle custom game filters
alice-blue Dec 4, 2024
d6421d7
Misc fixes
alice-blue Dec 4, 2024
84ec727
Revise message to make it clear that results were actually filtered
alice-blue Dec 5, 2024
6b05a60
Make a function to generate the "games were filtered" message since i…
alice-blue Dec 5, 2024
a0f8cbf
newitems.php: Modify getNewItems function to deal with game filters
alice-blue Dec 8, 2024
5cfbedb
allnew: show "games were filtered" message
alice-blue Dec 8, 2024
9066155
searchutil.php: revise the games filtered announcement function so th…
alice-blue Dec 8, 2024
9fd2143
search: use new parameters for filtered game message function
alice-blue Dec 8, 2024
afb1b7d
home: add $game_filter_was_applied
alice-blue Dec 8, 2024
d5e78b5
Update competitions.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
1b15649
Update recommended-lists.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
7740129
Update reviews.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
dc02597
games.php: add $game_filter_was_applied
alice-blue Dec 8, 2024
08b3e2b
allnew: Remember if we're overriding the game filter when going to an…
alice-blue Dec 8, 2024
acfc5b2
search: When we go to the next page of results, remember if we're ov…
alice-blue Dec 8, 2024
6768a79
searchutil.php: Avoid implying that results were hidden, since we don…
alice-blue Dec 8, 2024
89abff7
searchutil.php: the --> that
alice-blue Dec 8, 2024
61fbf4c
add lastReviewDate column to gameRatingsSandbox0_mv
alice-blue Jan 11, 2025
5b7854f
add lastreviewdate to line 430
alice-blue Jan 16, 2025
ee2c725
compute the maximum lastReviewDate of all of the grouped rows where h…
alice-blue Jan 16, 2025
235cde7
game id for testing
alice-blue Jan 16, 2025
e30b238
comment out specific game that we were testing
alice-blue Jan 16, 2025
5afce90
lastReviewDate --> lastRatingDate
alice-blue Jan 17, 2025
e81351f
lastRatingDate --> lastRatingOrReviewDate
alice-blue Jan 17, 2025
1c43e30
put lastReviewDate in all the right places
alice-blue Jan 17, 2025
86352e0
; --> ,
alice-blue Jan 17, 2025
f6d9984
+ key
alice-blue Jan 17, 2025
5753fb8
trying to sort by the lastReview column
alice-blue Jan 17, 2025
b2dfe67
remove lines for specific game being tested
alice-blue Jan 18, 2025
f6276fb
limit to 100 resuults
alice-blue Jan 18, 2025
a55a0ed
Update comments
alice-blue Jan 18, 2025
255a5df
oops, $limit should be a clause
alice-blue Jan 18, 2025
fe0e521
unscrub-ifarchive.sql: tinyint --> datetime
alice-blue Jan 18, 2025
207acf6
add "lastreview:" search prefix
alice-blue Jan 18, 2025
b0de404
newitems.php: Add "lastReviewDate:90d-" to search term when looking f…
alice-blue Jan 18, 2025
a6d0fcd
newitems: when fetching reviews and a filter is applied, look for gam…
alice-blue Jan 18, 2025
9519782
revise comments
alice-blue Jan 18, 2025
2449900
misc fixes
alice-blue Jan 18, 2025
69c1c3a
explain "lastreview:" in the comments
alice-blue Jan 18, 2025
d0f1a38
comment
alice-blue Jan 18, 2025
52c172b
Merge branch 'main' into filter-games-version-3
alice-blue Jan 18, 2025
157bf5f
searchutil.php: Add $count_all_possible_rows parameter to doSearch
alice-blue Jan 19, 2025
310ebac
ifdb-recommends.php: Use $count_all_possible_rows parameter in call t…
alice-blue Jan 19, 2025
be1f667
review: Use $count_all_possible_rows parameter and $override_game_fil…
alice-blue Jan 19, 2025
0954a8b
search: Use $count_all_possible_rows parameter in call to doSearch
alice-blue Jan 19, 2025
db7086a
editgame: Use $count_all_possible_rows and $override_game_filter para…
alice-blue Jan 19, 2025
9bc40d4
length($rows) --> count($rows) (to get rid of fatal error)
alice-blue Jan 19, 2025
166f2f6
$where --> !$term
alice-blue Jan 19, 2025
b571fc5
Combine conditions & comments
alice-blue Jan 19, 2025
8796aec
Merge branch 'main' into doSearch-need_total_rows-parameter
alice-blue Jan 20, 2025
f3d6803
Merge branch 'main' into filter-games-merged
dfabulich Jan 22, 2025
663cef4
Merge branch 'ifdb-recommends-performance' into filter-games-merged
dfabulich Jan 22, 2025
30cc954
Merge branch 'use-doSearch-for-newitems' into filter-games-merged
dfabulich Jan 22, 2025
07c67d6
Merge pull request #9 from dfabulich/filter-games-merged
alice-blue Jan 22, 2025
319a01e
searchutil.php: remove redundant lines
alice-blue Jan 22, 2025
9ce96d2
editprofile: update description of game filtering to say it applies t…
alice-blue Jan 23, 2025
1003e84
newitems.php: leave out the last review date limit if we need 20+ rev…
alice-blue Jan 23, 2025
4510639
use clearer variable to accomplish the same effect
alice-blue Jan 23, 2025
7f4e701
Mention that this applies to the "New Reviews on IFDB" page
alice-blue Jan 23, 2025
a32141f
Merge branch 'main' into filter-games-version-3
dfabulich Feb 3, 2025
37a1f48
Always search games to find new reviews
dfabulich Feb 3, 2025
b29b7ea
Merge branch 'searchutil-inner-join-gameratings' into always-search-g…
dfabulich Feb 3, 2025
41094c4
newitems.php: get $game_filter_was_applied from doSearch
alice-blue Feb 4, 2025
e9974e7
Update newitems.php
alice-blue Feb 4, 2025
c521685
Merge pull request #10 from dfabulich/always-search-games-for-new-rev…
alice-blue Feb 4, 2025
daef845
Add `lastReviewDate` to `gameRatingsSandbox01`
dfabulich Aug 18, 2025
8d207a2
Patch full schema
dfabulich Aug 18, 2025
299d173
Merge pull request #11 from dfabulich/sandboxed-lastReviewDate
alice-blue Aug 19, 2025
2c2c481
Merge pull request #12 from dfabulich/filter-games-patch-full-schema
alice-blue Aug 19, 2025
b449361
Merge branch 'main' into filter-games-version-3
alice-blue Aug 19, 2025
bf96322
Fix `refresh_gameRatingsSandbox0_mv` stored procedure
dfabulich Aug 28, 2025
fdd17d4
Merge pull request #13 from dfabulich/fix-mv-last-review-date
alice-blue Aug 30, 2025
f5250d3
Remove "lastreview" search prefix from searchutil.php
alice-blue Aug 30, 2025
9e4b42b
Add view and materialized view to track recent game news
alice-blue Aug 31, 2025
4c3d00c
Exclude deleted news items
alice-blue Sep 1, 2025
8934fb5
Add key (game_id) to recentgamenews materialized view
alice-blue Sep 1, 2025
069f447
gametimes --> recentgamenews
alice-blue Sep 1, 2025
5690ec5
Add a recent_game_news sorting option to the $sortList in searchutil.…
alice-blue Sep 1, 2025
c7c7b51
Explain what A means
alice-blue Sep 1, 2025
8d7c167
newitems.php: In the game news query, limit results to games that mat…
alice-blue Sep 1, 2025
d8d8dcb
newitems.php: Change recentgamenews_mv.game_id to g.id
alice-blue Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions sql/incoming-schema-changes.sql
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)
);



-- 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);


CREATE TRIGGER recentgamenews_delete
AFTER DELETE ON news FOR EACH ROW
call refresh_recentgamenews_mv(OLD.newsid);
Loading