Spaces:
Sleeping
Sleeping
Download reset_project_data.sql from refaelz/legacy-code-challenge-v2: direct link, hf CLI and curl.
- Browser
- Download file 984 Bytes
-
https://huggingface.co/spaces/refaelz/legacy-code-challenge-v2/resolve/main/reset_project_data.sql
- Command line
-
hf download hf://spaces/refaelz/legacy-code-challenge-v2/reset_project_data.sql
-
curl -L -o reset_project_data.sql https://huggingface.co/spaces/refaelz/legacy-code-challenge-v2/resolve/main/reset_project_data.sql
984 Bytes
| begin; | |
| do $$ | |
| declare | |
| tables_to_clear text; | |
| begin | |
| select string_agg(format('%I.%I', 'public', table_name), ', ' order by table_name) | |
| into tables_to_clear | |
| from unnest(array[ | |
| 'submission_instructor_feedback', | |
| 'challenge_retry_requests', | |
| 'submission_score_reviews', | |
| 'public_challenge_submissions', | |
| 'round_quota_operations', | |
| 'round_student_quotas', | |
| 'challenge_attempts', | |
| 'submissions', | |
| 'challenge_rounds', | |
| 'course_memberships', | |
| 'course_access_requests', | |
| 'personal_challenge_generations', | |
| 'challenge_generation_events', | |
| 'challenge_generation_runs', | |
| 'challenge_generation_failures', | |
| 'challenge_generation_prompt_rules' | |
| ]) as listed(table_name) | |
| where to_regclass(format('%I.%I', 'public', table_name)) is not null; | |
| if tables_to_clear is not null then | |
| execute 'truncate table ' || tables_to_clear; | |
| end if; | |
| end; | |
| $$; | |
| commit; |