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

テストケースに unique 属性を持たせる #40

Open
earlgray283 opened this issue Oct 29, 2022 · 4 comments
Open

テストケースに unique 属性を持たせる #40

earlgray283 opened this issue Oct 29, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@earlgray283
Copy link
Collaborator

earlgray283 commented Oct 29, 2022

重複を防ぎたいので

@earlgray283 earlgray283 self-assigned this Oct 29, 2022
@earlgray283 earlgray283 added the bug Something isn't working label Oct 29, 2022
@arumakan1727
Copy link

arumakan1727 commented Nov 3, 2022

テストケースって異なる問題に紐づくものも全部同一のテーブルに保持されるよね 👀
異なる問題に紐づく2つのテストケースが等しくなる可能性があるから、そこら辺を unique 制約で対応できるかな??

あと、入力テストケースが1つ 5MB を超えることもあり得て、内容の一致比較に時間がかかりそう!!!

@arumakan1727
Copy link

arumakan1727 commented Nov 3, 2022

↑ これ、unique (problem_id, content) みたいに制約つければいいだけだった (うっうっう)

@arumakan1727
Copy link

入力ケースがデカくなることはそんなにないだろうし、良いと思う!
このジャッジサイトの主な用途が中高生向け(簡単な問題がメイン)の場合は特に

@earlgray283
Copy link
Collaborator Author

DB に保存するのはテストケースの名前と紐づく問題 id だけで、content は保存されないからデータサイズについては心配しなくてもよさそうかな?content は Cloud Storage に保存されてる
https://github.com/szpp-dev-team/szpp-judge-backend/blob/main/migrations/2022-10-08-050646_testcases/up.sql#L1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants