Skip to content
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

Bug in history in the number of pages of a volume #2

Open
Metaroka opened this issue Aug 12, 2023 · 0 comments
Open

Bug in history in the number of pages of a volume #2

Metaroka opened this issue Aug 12, 2023 · 0 comments

Comments

@Metaroka
Copy link

The history does not update the total number of pages in the volume if they are added or deleted.

This corrects the situation:

UPDATE HISTORY SET PAGES_COUNT = NULL;

UPDATE HISTORY
SET PAGES_COUNT = 
  CASE 
    WHEN PAGES_COUNT IS NULL AND ARCHIVE_HASH IN (SELECT MANGA_ID FROM BOOK_ARCHIVES) 
      THEN (SELECT PAGES_COUNT FROM BOOK_ARCHIVES WHERE BOOK_ARCHIVES.MANGA_ID = HISTORY.ARCHIVE_HASH)
    WHEN PAGES_COUNT IS NULL AND CHAPTER_HASH IN (SELECT CHAPTER_ID FROM BOOK_CHAPTERS) 
      THEN (SELECT PAGES_COUNT FROM BOOK_CHAPTERS WHERE BOOK_CHAPTERS.CHAPTER_ID = HISTORY.CHAPTER_HASH)
    ELSE PAGES_COUNT 
  END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant