-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from croque-scp/reopt-post-download
Track last seen post timestamp per wiki
- Loading branch information
Showing
9 changed files
with
48 additions
and
7 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
4 changes: 4 additions & 0 deletions
4
notifier/database/migrations/010-track-latest-timestamp-per-wiki.down.sql
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,4 @@ | ||
ALTER TABLE | ||
context_wiki | ||
DROP COLUMN | ||
new_posts_checked_timestamp; |
9 changes: 9 additions & 0 deletions
9
notifier/database/migrations/010-track-latest-timestamp-per-wiki.up.sql
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,9 @@ | ||
ALTER TABLE | ||
context_wiki | ||
ADD COLUMN | ||
new_posts_checked_timestamp INT UNSIGNED NOT NULL; | ||
|
||
UPDATE | ||
context_wiki | ||
SET | ||
new_posts_checked_timestamp = 0; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
SELECT | ||
MAX(posted_timestamp) as posted_timestamp | ||
new_posts_checked_timestamp AS posted_timestamp | ||
FROM | ||
notifiable_post | ||
context_wiki | ||
WHERE | ||
notifiable_post.context_wiki_id = %(wiki_id)s | ||
context_wiki.wiki_id = %(wiki_id)s |
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,6 @@ | ||
UPDATE | ||
context_wiki | ||
SET | ||
new_posts_checked_timestamp = %(timestamp)s | ||
WHERE | ||
context_wiki.wiki_id = %(wiki_id)s |
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