From 92008556b11f01c66f3726640b904203edfd15b0 Mon Sep 17 00:00:00 2001 From: larry-aptos <112209412+larry-aptos@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:24:55 -0700 Subject: [PATCH] [indexer] alter public key to use text type. (#499) * alter public key to use text type. * fix linter. --- .../down.sql | 3 +++ .../up.sql | 3 +++ rust/processor/src/db/postgres/schema.rs | 3 +-- rust/processor/src/processors/mod.rs | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/down.sql create mode 100644 rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/up.sql diff --git a/rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/down.sql b/rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/down.sql new file mode 100644 index 000000000..85a82e6a2 --- /dev/null +++ b/rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/down.sql @@ -0,0 +1,3 @@ +-- This file should undo anything in `up.sql` +ALTER TABLE signatures + ALTER COLUMN public_key TYPE VARCHAR(136); \ No newline at end of file diff --git a/rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/up.sql b/rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/up.sql new file mode 100644 index 000000000..72e1149af --- /dev/null +++ b/rust/processor/src/db/postgres/migrations/2024-09-03-232100_alter_signature_public_key_to_text/up.sql @@ -0,0 +1,3 @@ +-- Your SQL goes here +ALTER TABLE signatures + ALTER COLUMN public_key TYPE TEXT; \ No newline at end of file diff --git a/rust/processor/src/db/postgres/schema.rs b/rust/processor/src/db/postgres/schema.rs index d5cb7a917..a35e5f447 100644 --- a/rust/processor/src/db/postgres/schema.rs +++ b/rust/processor/src/db/postgres/schema.rs @@ -963,8 +963,7 @@ diesel::table! { is_sender_primary -> Bool, #[sql_name = "type"] type_ -> Varchar, - #[max_length = 136] - public_key -> Varchar, + public_key -> Text, signature -> Text, threshold -> Int8, public_key_indices -> Jsonb, diff --git a/rust/processor/src/processors/mod.rs b/rust/processor/src/processors/mod.rs index d51544302..508b91e88 100644 --- a/rust/processor/src/processors/mod.rs +++ b/rust/processor/src/processors/mod.rs @@ -99,6 +99,7 @@ pub trait ProcessorTrait: Send + Sync + Debug { /// Gets the connection. /// If it was unable to do so (default timeout: 30s), it will keep retrying until it can. + #[allow(elided_named_lifetimes)] async fn get_conn(&self) -> DbPoolConnection { let pool = self.connection_pool(); loop {