-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4317 from brave/tip-vg
Fixes contribution with unblinded tokens
- Loading branch information
Showing
11 changed files
with
214 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
42 changes: 42 additions & 0 deletions
42
test/data/rewards-data/migration/publisher_info_schema_v14.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
index|activity_info_publisher_id_index|activity_info|CREATE INDEX activity_info_publisher_id_index ON activity_info (publisher_id) | ||
index|contribution_info_publishers_contribution_id_index|contribution_info_publishers|CREATE INDEX contribution_info_publishers_contribution_id_index ON contribution_info_publishers (contribution_id) | ||
index|contribution_info_publishers_publisher_key_index|contribution_info_publishers|CREATE INDEX contribution_info_publishers_publisher_key_index ON contribution_info_publishers (publisher_key) | ||
index|pending_contribution_publisher_id_index|pending_contribution|CREATE INDEX pending_contribution_publisher_id_index ON pending_contribution (publisher_id) | ||
index|promotion_creds_promotion_id_index|promotion_creds|CREATE INDEX promotion_creds_promotion_id_index ON promotion_creds (promotion_id) | ||
index|promotion_promotion_id_index|promotion|CREATE INDEX promotion_promotion_id_index ON promotion (promotion_id) | ||
index|recurring_donation_publisher_id_index|recurring_donation|CREATE INDEX recurring_donation_publisher_id_index ON recurring_donation (publisher_id) | ||
index|server_publisher_amounts_publisher_key_index|server_publisher_amounts|CREATE INDEX server_publisher_amounts_publisher_key_index ON server_publisher_amounts (publisher_key) | ||
index|server_publisher_banner_publisher_key_index|server_publisher_banner|CREATE INDEX server_publisher_banner_publisher_key_index ON server_publisher_banner (publisher_key) | ||
index|server_publisher_info_publisher_key_index|server_publisher_info|CREATE INDEX server_publisher_info_publisher_key_index ON server_publisher_info (publisher_key) | ||
index|server_publisher_links_publisher_key_index|server_publisher_links|CREATE INDEX server_publisher_links_publisher_key_index ON server_publisher_links (publisher_key) | ||
index|sqlite_autoindex_activity_info_1|activity_info| | ||
index|sqlite_autoindex_contribution_info_1|contribution_info| | ||
index|sqlite_autoindex_media_publisher_info_1|media_publisher_info| | ||
index|sqlite_autoindex_meta_1|meta| | ||
index|sqlite_autoindex_promotion_1|promotion| | ||
index|sqlite_autoindex_promotion_creds_1|promotion_creds| | ||
index|sqlite_autoindex_publisher_info_1|publisher_info| | ||
index|sqlite_autoindex_recurring_donation_1|recurring_donation| | ||
index|sqlite_autoindex_server_publisher_amounts_1|server_publisher_amounts| | ||
index|sqlite_autoindex_server_publisher_banner_1|server_publisher_banner| | ||
index|sqlite_autoindex_server_publisher_info_1|server_publisher_info| | ||
index|sqlite_autoindex_server_publisher_links_1|server_publisher_links| | ||
index|unblinded_tokens_token_id_index|unblinded_tokens|CREATE INDEX unblinded_tokens_token_id_index ON unblinded_tokens (token_id) | ||
table|activity_info|activity_info|CREATE TABLE activity_info(publisher_id LONGVARCHAR NOT NULL,duration INTEGER DEFAULT 0 NOT NULL,visits INTEGER DEFAULT 0 NOT NULL,score DOUBLE DEFAULT 0 NOT NULL,percent INTEGER DEFAULT 0 NOT NULL,weight DOUBLE DEFAULT 0 NOT NULL,reconcile_stamp INTEGER DEFAULT 0 NOT NULL,CONSTRAINT activity_unique UNIQUE (publisher_id, reconcile_stamp) CONSTRAINT fk_activity_info_publisher_id FOREIGN KEY (publisher_id) REFERENCES "publisher_info_old" (publisher_id) ON DELETE CASCADE) | ||
table|contribution_info|contribution_info|CREATE TABLE contribution_info (contribution_id TEXT NOT NULL,amount DOUBLE NOT NULL,type INTEGER NOT NULL,step INTEGER NOT NULL DEFAULT -1,retry_count INTEGER NOT NULL DEFAULT -1,created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,PRIMARY KEY (contribution_id)) | ||
table|contribution_info_publishers|contribution_info_publishers|CREATE TABLE contribution_info_publishers (contribution_id TEXT NOT NULL,publisher_key TEXT NOT NULL,total_amount DOUBLE NOT NULL,contributed_amount DOUBLE,CONSTRAINT fk_contribution_info_publishers_contribution_id FOREIGN KEY (contribution_id) REFERENCES "contribution_info_temp" (contribution_id) ON DELETE CASCADE,CONSTRAINT fk_contribution_info_publishers_publisher_id FOREIGN KEY (publisher_key) REFERENCES publisher_info (publisher_id)) | ||
table|contribution_queue|contribution_queue|CREATE TABLE contribution_queue (contribution_queue_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,type INTEGER NOT NULL,amount DOUBLE NOT NULL,partial INTEGER NOT NULL DEFAULT 0,created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL) | ||
table|contribution_queue_publishers|contribution_queue_publishers|CREATE TABLE contribution_queue_publishers (contribution_queue_id INTEGER NOT NULL,publisher_key TEXT NOT NULL,amount_percent DOUBLE NOT NULL,CONSTRAINT fk_contribution_queue_publishers_publisher_key FOREIGN KEY (publisher_key) REFERENCES publisher_info (publisher_id),CONSTRAINT fk_contribution_queue_publishers_id FOREIGN KEY (contribution_queue_id) REFERENCES contribution_queue (contribution_queue_id) ON DELETE CASCADE) | ||
table|media_publisher_info|media_publisher_info|CREATE TABLE media_publisher_info(media_key TEXT NOT NULL PRIMARY KEY UNIQUE,publisher_id LONGVARCHAR NOT NULL,CONSTRAINT fk_media_publisher_info_publisher_id FOREIGN KEY (publisher_id) REFERENCES "publisher_info_old" (publisher_id) ON DELETE CASCADE) | ||
table|meta|meta|CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR) | ||
table|pending_contribution|pending_contribution|CREATE TABLE pending_contribution (pending_contribution_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,publisher_id LONGVARCHAR NOT NULL,amount DOUBLE DEFAULT 0 NOT NULL,added_date INTEGER DEFAULT 0 NOT NULL,viewing_id LONGVARCHAR NOT NULL,type INTEGER NOT NULL,CONSTRAINT fk_pending_contribution_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher_info (publisher_id) ON DELETE CASCADE) | ||
table|promotion|promotion|CREATE TABLE promotion (promotion_id TEXT NOT NULL,version INTEGER NOT NULL,type INTEGER NOT NULL,public_keys TEXT NOT NULL,suggestions INTEGER NOT NULL DEFAULT 0,approximate_value DOUBLE NOT NULL DEFAULT 0,status INTEGER NOT NULL DEFAULT 0,expires_at TIMESTAMP NOT NULL,created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, claimed_at TIMESTAMP,PRIMARY KEY (promotion_id)) | ||
table|promotion_creds|promotion_creds|CREATE TABLE promotion_creds (promotion_id TEXT UNIQUE NOT NULL,tokens TEXT NOT NULL,blinded_creds TEXT NOT NULL,signed_creds TEXT,public_key TEXT,batch_proof TEXT,claim_id TEXT,CONSTRAINT fk_promotion_creds_promotion_id FOREIGN KEY (promotion_id) REFERENCES promotion (promotion_id) ON DELETE CASCADE) | ||
table|publisher_info|publisher_info|CREATE TABLE publisher_info(publisher_id LONGVARCHAR PRIMARY KEY NOT NULL UNIQUE,excluded INTEGER DEFAULT 0 NOT NULL,name TEXT NOT NULL,favIcon TEXT NOT NULL,url TEXT NOT NULL,provider TEXT NOT NULL) | ||
table|recurring_donation|recurring_donation|CREATE TABLE recurring_donation(publisher_id LONGVARCHAR NOT NULL PRIMARY KEY UNIQUE,amount DOUBLE DEFAULT 0 NOT NULL,added_date INTEGER DEFAULT 0 NOT NULL,CONSTRAINT fk_recurring_donation_publisher_id FOREIGN KEY (publisher_id) REFERENCES "publisher_info_old" (publisher_id) ON DELETE CASCADE) | ||
table|server_publisher_amounts|server_publisher_amounts|CREATE TABLE server_publisher_amounts (publisher_key LONGVARCHAR NOT NULL,amount DOUBLE DEFAULT 0 NOT NULL,CONSTRAINT server_publisher_amounts_unique UNIQUE (publisher_key, amount) CONSTRAINT fk_server_publisher_amounts_publisher_key FOREIGN KEY (publisher_key) REFERENCES server_publisher_info (publisher_key) ON DELETE CASCADE) | ||
table|server_publisher_banner|server_publisher_banner|CREATE TABLE server_publisher_banner (publisher_key LONGVARCHAR PRIMARY KEY NOT NULL UNIQUE,title TEXT,description TEXT,background TEXT,logo TEXT,CONSTRAINT fk_server_publisher_banner_publisher_key FOREIGN KEY (publisher_key) REFERENCES server_publisher_info (publisher_key) ON DELETE CASCADE) | ||
table|server_publisher_info|server_publisher_info|CREATE TABLE server_publisher_info (publisher_key LONGVARCHAR PRIMARY KEY NOT NULL UNIQUE,status INTEGER DEFAULT 0 NOT NULL,excluded INTEGER DEFAULT 0 NOT NULL,address TEXT NOT NULL) | ||
table|server_publisher_links|server_publisher_links|CREATE TABLE server_publisher_links (publisher_key LONGVARCHAR NOT NULL,provider TEXT,link TEXT,CONSTRAINT server_publisher_links_unique UNIQUE (publisher_key, provider) CONSTRAINT fk_server_publisher_links_publisher_key FOREIGN KEY (publisher_key) REFERENCES server_publisher_info (publisher_key) ON DELETE CASCADE) | ||
table|sqlite_sequence|sqlite_sequence|CREATE TABLE sqlite_sequence(name,seq) | ||
table|unblinded_tokens|unblinded_tokens|CREATE TABLE unblinded_tokens (token_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,token_value TEXT,public_key TEXT,value DOUBLE NOT NULL DEFAULT 0,promotion_id TEXT,created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT fk_unblinded_tokens_promotion_id FOREIGN KEY (promotion_id) REFERENCES promotion (promotion_id) ON DELETE CASCADE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters