Skip to content

Commit

Permalink
Define Codespaces database table
Browse files Browse the repository at this point in the history
Use a broad composite key to ensure uniqueness and stability over time.
Candidate "id" fields from Codespaces API not used as minimally documented
by GitHub and thus untrustworthy. Large composite primary key does have
performance penalities, but for the expected data volume this is not
presumed to be significant.
  • Loading branch information
Jongmassey committed May 31, 2024
1 parent 5828f9c commit ee51522
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions metrics/timescaledb/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
metadata = MetaData()


GitHubCodespaces = Table(
"github_codespaces",
metadata,
Column("created_at", TIMESTAMP(timezone=True), primary_key=True),
Column("organisation", Text, primary_key=True),
Column("repo", Text, primary_key=True),
Column("user", Text, primary_key=True),
Column("last_used_at", TIMESTAMP(timezone=True)),
)

GitHubRepos = Table(
"github_repos",
metadata,
Expand Down

0 comments on commit ee51522

Please sign in to comment.