Skip to content

Commit

Permalink
Add update sequence script
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Nov 23, 2024
1 parent 0b04abc commit c25952c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data_migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Postup migrácie dát na web:
4. `problems.csv` - Do `competition_problems`
5. `events.csv` - Do `competition_event`
6. `publications.csv` - Do `competition_publication`
8.
8. Pustiť skript pre úpravu sekvencií `update_sequences.sql`
5 changes: 4 additions & 1 deletion data_migration/data_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ def build_grades_dictionary():
for grade in grades:
grade_dict[grade['fields']['tag']] = {
'id': grade['pk'],
'name': grade['name']['name'],
'name': grade['fields']['name'],
'tag': grade['fields']['tag'],
'years_until_graduation': grade['fields']['years_until_graduation']
}
grade_dict['S5'] = grade_dict['S4']
grade_dict[''] = {'id': '', 'name': '',
'tag': '', 'years_until_graduation': ''}
return grade_dict


Expand Down
4 changes: 4 additions & 0 deletions data_migration/update_sequences.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT setval('competition_event_id_seq', 160, true);
SELECT setval('competition_series_id_seq', 160, true);
SELECT setval('competition_problem_id_seq', 1000, true);
SELECT setval('competition_publication_id_seq', 350, true);

0 comments on commit c25952c

Please sign in to comment.