You've already forked AstralRinth
forked from didirus/AstralRinth
Add affiliate code revenue analytics (#4883)
* Add affiliate code revenue analytics * clean up some error handling * Add conversions to affiliate code analytics * Only include affiliate subscriptions which have an associated successful charge * wip: affiliate code clicks * affiliate code click ingest route * Add affiliate code clicks to analytics * add new cols
This commit is contained in:
@@ -135,5 +135,30 @@ pub async fn init_client_with_database(
|
||||
.execute()
|
||||
.await?;
|
||||
|
||||
client
|
||||
.query(&format!(
|
||||
"
|
||||
CREATE TABLE IF NOT EXISTS {database}.affiliate_code_clicks {cluster_line}
|
||||
(
|
||||
recorded DateTime64(4),
|
||||
domain String,
|
||||
|
||||
user_id UInt64,
|
||||
affiliate_code_id UInt64,
|
||||
|
||||
ip IPv6,
|
||||
country String,
|
||||
user_agent String,
|
||||
headers Array(Tuple(String, String))
|
||||
)
|
||||
ENGINE = {engine}
|
||||
{ttl}
|
||||
PRIMARY KEY (affiliate_code_id, recorded)
|
||||
SETTINGS index_granularity = 8192
|
||||
"
|
||||
))
|
||||
.execute()
|
||||
.await?;
|
||||
|
||||
Ok(client.with_database(database))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user