22 lines
801 B
Markdown
22 lines
801 B
Markdown
# Block for inserting/upserting scores into the scores table
|
|
|
|
This block is responsible for inserting or updating score records in the `scores` table using the same database configuration as `db_push_v1`.
|
|
|
|
## Table DDL
|
|
|
|
The following DDL illustrates the `scores` table structure (Postgres style, conceptually compatible with DuckDB for tests):
|
|
|
|
```sql
|
|
-- creating scores table
|
|
CREATE TABLE IF NOT EXISTS scores (
|
|
application_key TEXT PRIMARY KEY,
|
|
application_timestamp TIMESTAMP NOT NULL,
|
|
hd_score_m1 DOUBLE PRECISION NULL,
|
|
hd_score_m2 DOUBLE PRECISION NULL,
|
|
hd_score_iso_m2 DOUBLE PRECISION NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_scores_application_key ON scores(application_key);
|
|
CREATE INDEX IF NOT EXISTS idx_scores_application_timestamp ON scores(application_timestamp);
|
|
```
|