aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-07 23:21:47 +0900
committernsfisis <nsfisis@gmail.com>2024-08-08 04:02:37 +0900
commit14f48b4e4f7463e0972c2a5b39e94ee674ec93ba (patch)
tree746838d2b9bd9df69111f824412b4783dd27b8ee /backend
parent0e8410f39e91b3b11063cb940926107639a2bc89 (diff)
downloadiosdc-japan-2025-albatross-14f48b4e4f7463e0972c2a5b39e94ee674ec93ba.tar.gz
iosdc-japan-2025-albatross-14f48b4e4f7463e0972c2a5b39e94ee674ec93ba.tar.zst
iosdc-japan-2025-albatross-14f48b4e4f7463e0972c2a5b39e94ee674ec93ba.zip
feat(backend): add unique constraint to testcase_results
Diffstat (limited to 'backend')
-rw-r--r--backend/schema.sql3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/schema.sql b/backend/schema.sql
index 53c68ec..7188d72 100644
--- a/backend/schema.sql
+++ b/backend/schema.sql
@@ -73,6 +73,7 @@ CREATE TABLE testcase_results (
stderr TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
CONSTRAINT fk_submission_id FOREIGN KEY(submission_id) REFERENCES submissions(submission_id),
- CONSTRAINT fk_testcase_id FOREIGN KEY(testcase_id) REFERENCES testcases(testcase_id)
+ CONSTRAINT fk_testcase_id FOREIGN KEY(testcase_id) REFERENCES testcases(testcase_id),
+ CONSTRAINT uq_submission_id_testcase_id UNIQUE(submission_id, testcase_id)
);
CREATE INDEX idx_testcase_results_submission_id ON testcase_results(submission_id);