feat: add elo tables for house ranking

This commit is contained in:
Stijnvandenbroek
2026-03-06 10:49:24 +00:00
parent ccfd453dfe
commit 732e50924e
8 changed files with 151 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
create table if not exists {{ schema }}.comparisons (
id serial primary key,
listing_a_id text not null,
listing_b_id text not null,
winner_id text not null,
elo_a_before double precision not null,
elo_b_before double precision not null,
elo_a_after double precision not null,
elo_b_after double precision not null,
created_at timestamptz default now()
);

View File

@@ -0,0 +1,9 @@
create table if not exists {{ schema }}.ratings (
global_id text primary key,
elo_rating double precision not null default 1500.0,
comparison_count integer not null default 0,
wins integer not null default 0,
losses integer not null default 0,
created_at timestamptz default now(),
updated_at timestamptz default now()
);

View File

@@ -0,0 +1 @@
create schema if not exists {{ schema }};