30 lines
1016 B
Markdown
30 lines
1016 B
Markdown
# Block for inserting/upserting THX attributes into the thx table
|
|
|
|
This block is responsible for inserting or updating THX-related records in the `thx` table using the same database configuration as `db_push_v1`.
|
|
|
|
## Table DDL
|
|
|
|
The following DDL illustrates the `thx` table structure (Postgres style, conceptually compatible with DuckDB for tests):
|
|
|
|
```sql
|
|
-- creating thx table
|
|
CREATE TABLE IF NOT EXISTS thx (
|
|
application_key TEXT PRIMARY KEY,
|
|
application_timestamp TIMESTAMP NULL,
|
|
digital_id_first_seen TEXT NULL,
|
|
summary_risk_score TEXT NULL,
|
|
cpu_clock TEXT NULL,
|
|
true_ip_first_seen TEXT NULL,
|
|
ssn_hash_first_seen TEXT NULL,
|
|
account_email_attributes TEXT NULL,
|
|
tps_ip_latitude TEXT NULL,
|
|
tps_ip_longitude TEXT NULL,
|
|
account_telephone_first_seen TEXT NULL,
|
|
account_login_first_seen TEXT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_thx_application_key ON thx(application_key);
|
|
CREATE INDEX IF NOT EXISTS idx_thx_application_timestamp ON thx(application_timestamp);
|
|
```
|
|
|