@startuml gh_aw_dataset_v0_1_er title gh-aw-dataset-builder ER hide circle skinparam linetype ortho skinparam entity { BackgroundColor White BorderColor #2F5D7C } entity "repository" as repository { * repository_id : int64 <> -- url : string license : string repo_full_name : string repo_owner : string repo_name : string main_language : string forks : int64 stars : int64 created_at : string updated_at : string pushed_at : string } entity "source_markdown_file_history" as source_markdown_file_history { * source_markdown_file_history_id : int64 <> -- version_count : int64 } entity "source_markdown_file_version" as source_markdown_file_version { * source_markdown_file_version_id : int64 <> -- * source_markdown_file_history_id : int64 <> * source_markdown_file_snapshot_id : int64 <> commit_sha : string committed_at : string rank : int64 predecessor_source_markdown_file_version_id : int64 successor_source_markdown_file_version_id : int64 } entity "source_markdown_file_snapshot" as source_markdown_file_snapshot { * source_markdown_file_snapshot_id : int64 <> -- * repository_id : int64 <> path : string content : string frontmatter : string body : string } entity "lock_file_snapshot" as lock_file_snapshot { * lock_file_snapshot_id : int64 <> -- * source_markdown_file_version_id : int64 <> path : string content : string file_sha : string } repository ||--|{ source_markdown_file_snapshot : "1 -> 1..N" source_markdown_file_snapshot ||--|| source_markdown_file_version : "1 -> 1" source_markdown_file_history ||--|{ source_markdown_file_version : "1 -> 1..N" source_markdown_file_version ||--|| lock_file_snapshot : "1 -> 1" note right of repository repository_id is the internal dataset PK. created_at, updated_at, and pushed_at are GitHub repository API timestamps. end note note right of source_markdown_file_history source_history groups versions. Path is obtained through version -> snapshot. end note note right of source_markdown_file_snapshot First observable source_history fact from repository. end note note right of lock_file_snapshot Lock artifact snapshot aligned to the source Markdown version commit. Published source_history requires exactly one lock snapshot per version. end note @enduml