BREAKING: make transaction_id the primary key in transactions lookup table

This commit is contained in:
GroovieGermanikus 2024-02-08 08:02:03 +01:00
parent c636847d90
commit 9c7d769afc
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
2 changed files with 7 additions and 7 deletions

View File

@ -1,9 +1,9 @@
CREATE SCHEMA banking_stage_results_2;
CREATE TABLE banking_stage_results_2.transactions(
signature char(88) primary key,
transaction_id bigserial,
UNIQUE(transaction_id)
transaction_id bigserial PRIMARY KEY,
signature varchar(88) NOT NULL,
UNIQUE(signature)
);
CREATE TABLE banking_stage_results_2.transaction_infos (
@ -46,8 +46,8 @@ CREATE TABLE banking_stage_results_2.blocks (
);
CREATE TABLE banking_stage_results_2.accounts(
acc_id bigserial primary key,
account_key char(44),
acc_id bigserial PRIMARY KEY,
account_key varchar(44) NOT NULL,
UNIQUE (account_key)
);

View File

@ -235,7 +235,7 @@ impl PostgresSession {
let statement = format!(
r#"
INSERT INTO banking_stage_results_2.transactions(signature) SELECT signature from {}
ON CONFLICT DO NOTHING
ON CONFLICT(signature) DO NOTHING
"#,
temp_table
);
@ -296,7 +296,7 @@ impl PostgresSession {
let statement = format!(
r#"
INSERT INTO banking_stage_results_2.accounts(account_key) SELECT key from {}
ON CONFLICT DO NOTHING
ON CONFLICT(account_key) DO NOTHING
"#,
temp_table
);