feat: add elo tables for house ranking
This commit is contained in:
11
data_platform/assets/elo/sql/create_comparisons_table.sql
Normal file
11
data_platform/assets/elo/sql/create_comparisons_table.sql
Normal 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()
|
||||
);
|
||||
9
data_platform/assets/elo/sql/create_ratings_table.sql
Normal file
9
data_platform/assets/elo/sql/create_ratings_table.sql
Normal 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()
|
||||
);
|
||||
1
data_platform/assets/elo/sql/create_schema.sql
Normal file
1
data_platform/assets/elo/sql/create_schema.sql
Normal file
@@ -0,0 +1 @@
|
||||
create schema if not exists {{ schema }};
|
||||
Reference in New Issue
Block a user