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

feat(graphql): add Character & Person & Subject relations #677

Merged
merged 12 commits into from
Sep 21, 2024

Conversation

everpcpc
Copy link
Contributor

@everpcpc everpcpc commented Jun 28, 2024

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 88.80407% with 44 lines in your changes missing coverage. Please review.

Project coverage is 80.80%. Comparing base (7231de9) to head (4f5a001).
Report is 185 commits behind head on master.

Files with missing lines Patch % Lines
lib/graphql/types/character.ts 77.64% 19 Missing ⚠️
lib/graphql/types/person.ts 76.82% 19 Missing ⚠️
bin/fix-date.ts 0.00% 4 Missing ⚠️
lib/subject/date.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #677      +/-   ##
==========================================
- Coverage   81.98%   80.80%   -1.18%     
==========================================
  Files          69       82      +13     
  Lines        8554     9618    +1064     
  Branches      405      531     +126     
==========================================
+ Hits         7013     7772     +759     
- Misses       1536     1846     +310     
+ Partials        5        0       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@everpcpc everpcpc marked this pull request as ready for review June 28, 2024 23:48
@everpcpc
Copy link
Contributor Author

everpcpc commented Jun 28, 2024

@trim21 能帮忙搞点测试数据吗,现在 sample data 里的 person & character 有对应关系的太少了,没法测

@everpcpc everpcpc changed the title feat(graphql): add CharacterSubjects and PersonSubjects feat(graphql): add Character & Person & Subject relations Jun 28, 2024
@trim21
Copy link
Contributor

trim21 commented Jun 29, 2024

@trim21 能帮忙搞点测试数据吗,现在 sample data 里的 person & character 有对应关系的太少了,没法测

哪几个表?

@everpcpc
Copy link
Contributor Author

  • chii_person_cs_index
  • chii_crt_cast_index
  • chii_crt_subject_index
  • chii_subject_relations

这四个表里 subject id 为 12 的条目,以及对应展开的 person/character/subject

@trim21
Copy link
Contributor

trim21 commented Aug 14, 2024

好懒,能不能写一下对应的sql(

@everpcpc
Copy link
Contributor Author

什么样的 sql,有例子吗

@trim21
Copy link
Contributor

trim21 commented Sep 14, 2024

什么样的 sql,有例子吗

就标准的select,能直接把你要的数据select出来的那种(

@trim21
Copy link
Contributor

trim21 commented Sep 15, 2024

大概这样? SELECT * FROM chii_persons WHERE prsn_id in (select prsn_id from chii_person_cs_index where subject_id=12);

@trim21
Copy link
Contributor

trim21 commented Sep 15, 2024

Downloads.zip 这是 chii_person_cs_index 的

@everpcpc
Copy link
Contributor Author

SELECT * FROM chii_person_cs_index WHERE subject_id=12;

SELECT * FROM chii_persons WHERE prsn_id in (SELECT prsn_id FROM chii_person_cs_index WHERE subject_id=12);

SELECT * FROM chii_crt_subject_index WHERE subject_id=12;

SELECT * FROM chii_characters WHERE crt_id in (SELECT crt_id FROM chii_crt_subject_index WHERE subject_id=12);

SELECT * FROM chii_crt_cast_index WHERE subject_id=12;

SELECT * FROM chii_subject_relations WHERE rlt_subject_id=12;

@trim21
Copy link
Contributor

trim21 commented Sep 15, 2024

Downloads.zip

为啥github让传zip不让传sql?

@everpcpc
Copy link
Contributor Author

hmmm,可以把这些数据直接加到 dev-env 里吗

@trim21
Copy link
Contributor

trim21 commented Sep 15, 2024

hmmm,可以把这些数据直接加到 dev-env 里吗

你 PR 一下(

@everpcpc
Copy link
Contributor Author

PTAL cc @trim21

@trim21 trim21 merged commit 1e681f9 into bangumi:master Sep 21, 2024
4 of 5 checks passed
@everpcpc everpcpc deleted the feat-relations branch September 21, 2024 02:38
Comment on lines +136 to +140
// @Column('mediumtext', {
// name: 'prsn_appear_eps',
// comment: '可选,人物参与的章节',
// })
// appearEps: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有计划加上对参与章节的支持吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的吧,有需求可以直接提 PR 改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants