Skip to content

Commit

Permalink
Add indices (#1308)
Browse files Browse the repository at this point in the history
* Add indices

* System test fixes
  • Loading branch information
nygrenh authored Sep 5, 2024
1 parent 9fb5f89 commit c75942f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
DROP INDEX peer_review_queue_entries_exercise_id_created_at_idx;
DROP INDEX roles_user_id_idx;
DROP INDEX course_module_completions_user_id_idx;
DROP INDEX exercise_tasks_exercise_slide_id_idx;
DROP INDEX peer_or_self_review_submission_exercise_slide_submission_id_idx;
DROP INDEX pages_chapter_id_idx;
DROP INDEX pages_page_language_group_id_idx;
DROP INDEX material_references_course_id_idx;
DROP INDEX pages_url_path_idx;
DROP INDEX pages_course_id_idx;
DROP INDEX exercise_task_regrading_submissions_regrading_id_idx;
DROP INDEX peer_review_queue_entries_receiving_peer_reviews_exercise_s_idx;
DROP INDEX exercises_chapter_id_idx;
DROP INDEX exercise_slide_submissions_user_id_exercise_slide_id_idx;
DROP INDEX peer_review_queue_entries_exercise_id_idx;
DROP INDEX users_upstream_id_idx;
DROP INDEX user_exercise_slide_states_user_exercise_state_id_idx;
DROP INDEX teacher_grading_decisions_user_exercise_state_id_idx;
DROP INDEX user_exercise_states_course_instance_id_idx;
DROP INDEX course_specific_consent_form_answers_user_id_idx;
24 changes: 24 additions & 0 deletions services/headless-lms/migrations/20240905095603_add_indices.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CREATE INDEX ON peer_review_queue_entries (exercise_id, created_at);
CREATE INDEX ON roles (user_id);
CREATE INDEX ON course_module_completions (user_id);
CREATE INDEX ON exercise_tasks (exercise_slide_id);
CREATE INDEX ON peer_or_self_review_submissions (exercise_slide_submission_id);
CREATE INDEX ON pages (chapter_id);
CREATE INDEX ON pages (page_language_group_id);
CREATE INDEX ON material_references (course_id);
CREATE INDEX ON pages (url_path);
CREATE INDEX ON pages (course_id);
CREATE INDEX ON exercise_task_regrading_submissions (regrading_id);
CREATE INDEX ON pages (course_id);
CREATE INDEX ON peer_review_queue_entries (
receiving_peer_reviews_exercise_slide_submission_id
);
CREATE INDEX ON exercises (chapter_id);
CREATE INDEX ON exercise_slide_submissions (user_id, exercise_slide_id);
CREATE INDEX ON peer_review_queue_entries (exercise_id);
CREATE INDEX ON users (upstream_id);
CREATE INDEX ON user_exercise_slide_states (user_exercise_state_id);
CREATE INDEX ON exercise_tasks (exercise_slide_id);
CREATE INDEX ON teacher_grading_decisions (user_exercise_state_id);
CREATE INDEX ON user_exercise_states (course_instance_id);
CREATE INDEX ON course_specific_consent_form_answers (user_id);
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test.describe(() => {
await frame.getByText("Pick all the programming languages from below").waitFor()

// eslint-disable-next-line playwright/no-conditional-in-test
if (testInfo.retry && (await page.getByText("Try again").isVisible())) {
if (testInfo.retry) {
await page.getByText("Try again").click()
await page.getByText("Try again").waitFor({ state: "hidden" })
await frame.getByText("Pick all the programming languages from below").waitFor()
Expand Down

0 comments on commit c75942f

Please sign in to comment.