You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduction
At the moment we have the problem that we have no way of knowing which record from the PuzzleSkills DB belongs to which record from the PuzzleTime DB. We can't do this by name or similar because we can't ensure these are atomic and consistent with our data. To solve this problem we have to map the values initially, so we later know if a record is new or already exists.
To know this we essentially want a foreign key on every person record in PuzzleSkills that references the primary keys from person records in PuzzleTime. So the first step is to create a db migration to add this new field.
For the initial mapping an idea was to write a mapper script that tries to find as many matching records as possible by using an attribute like the name. The matches that are unambiguous can then be mapped automatically. Ambiguous matches or unmatched entries should be sorted out by the script for manual mapping and confirmation.
ToDo
Add a field to the PuzzleSkills db with a name like puzzletime_id
Write a mapper script that maps the IDs from PuzzleTime to the puzzletime_id fields in PuzzleSkills by an Attribute like name.
Manually map or find another Method for the IDs that cannot be mapped automatically.
Tests
The text was updated successfully, but these errors were encountered:
Stand 21.06.2024
Ich habe die Migration erstellt. Ausserdem habe ich angefangen das Mapper Skript zu schreiben. Dieses kann jetzt sowohl Daten aus dem Puzzle Skills als auch aus dem Puzzle Time per http Request abfragen.
Postman kann übrigens aus den gesendeten Requests direkt den zugehörigen Ruby Code generieren 😉
Stand 27.06.2024
Das ist script ist nun fertig und auch tests dazu mit Hilfe von webmock sind geschrieben. Ausserdem haben wir einen PTime-API client geschrieben, mit dem man die get abfragen an die PuzzleTime API ausführen kann.
Das script ist über die Rake Task rake ptime:assign ausführbar. Diese task führt das Mapping direkt durch. Es gibt aber noch die zweite Rake Task: rake ptime:evaluate_assign. Diese macht das Selbe wie die erste Task, nur werden die IDs noch nicht assigned. Dadurch kann man einen dry-run ausführen, um vorher schon zu überprüfen, welche Personen aus dem Times gemapt werden können.
Introduction
At the moment we have the problem that we have no way of knowing which record from the PuzzleSkills DB belongs to which record from the PuzzleTime DB. We can't do this by name or similar because we can't ensure these are atomic and consistent with our data. To solve this problem we have to map the values initially, so we later know if a record is new or already exists.
To know this we essentially want a foreign key on every person record in PuzzleSkills that references the primary keys from person records in PuzzleTime. So the first step is to create a db migration to add this new field.
For the initial mapping an idea was to write a mapper script that tries to find as many matching records as possible by using an attribute like the name. The matches that are unambiguous can then be mapped automatically. Ambiguous matches or unmatched entries should be sorted out by the script for manual mapping and confirmation.
ToDo
The text was updated successfully, but these errors were encountered: