From 9dd0bae40a6f1542637a949aca30b7dc0ffcf42d Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sun, 18 Jun 2023 16:08:55 -0700 Subject: [PATCH] text instead of string payload --- Cargo.lock | 6 +-- entities/Cargo.toml | 2 +- migration/Cargo.toml | 2 +- migration/src/lib.rs | 2 + .../src/m20230618_230611_longer_payload.rs | 39 +++++++++++++++++++ web3_proxy/Cargo.toml | 2 +- 6 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 migration/src/m20230618_230611_longer_payload.rs diff --git a/Cargo.lock b/Cargo.lock index c5a61493..d551fc1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1676,7 +1676,7 @@ dependencies = [ [[package]] name = "entities" -version = "0.30.0" +version = "0.31.0" dependencies = [ "ethers", "sea-orm", @@ -3330,7 +3330,7 @@ dependencies = [ [[package]] name = "migration" -version = "0.30.0" +version = "0.31.0" dependencies = [ "sea-orm-migration", "tokio", @@ -6943,7 +6943,7 @@ dependencies = [ [[package]] name = "web3_proxy" -version = "0.30.0" +version = "0.31.0" dependencies = [ "anyhow", "arc-swap", diff --git a/entities/Cargo.toml b/entities/Cargo.toml index cfd6ba9d..afd8dad2 100644 --- a/entities/Cargo.toml +++ b/entities/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entities" -version = "0.30.0" +version = "0.31.0" edition = "2021" [lib] diff --git a/migration/Cargo.toml b/migration/Cargo.toml index 520a9c8f..7b07bccb 100644 --- a/migration/Cargo.toml +++ b/migration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "migration" -version = "0.30.0" +version = "0.31.0" edition = "2021" publish = false diff --git a/migration/src/lib.rs b/migration/src/lib.rs index cccd18a7..86596da2 100644 --- a/migration/src/lib.rs +++ b/migration/src/lib.rs @@ -30,6 +30,7 @@ mod m20230512_220213_allow_null_rpc_key_id_in_stats_v2; mod m20230514_114803_admin_add_credits; mod m20230607_221917_total_deposits; mod m20230615_221201_handle_payment_uncles; +mod m20230618_230611_longer_payload; pub struct Migrator; @@ -67,6 +68,7 @@ impl MigratorTrait for Migrator { Box::new(m20230514_114803_admin_add_credits::Migration), Box::new(m20230607_221917_total_deposits::Migration), Box::new(m20230615_221201_handle_payment_uncles::Migration), + Box::new(m20230618_230611_longer_payload::Migration), ] } } diff --git a/migration/src/m20230618_230611_longer_payload.rs b/migration/src/m20230618_230611_longer_payload.rs new file mode 100644 index 00000000..09f5e92c --- /dev/null +++ b/migration/src/m20230618_230611_longer_payload.rs @@ -0,0 +1,39 @@ +use sea_orm_migration::prelude::*; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .alter_table( + Table::alter() + .table(AdminTrail::Table) + .modify_column(ColumnDef::new(Post::Endpoint).text().not_null()) + .modify_column(ColumnDef::new(Post::Payload).text().not_null()) + .to_owned(), + ) + .await + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .alter_table( + Table::alter() + .table(Post::AdminTrail) + .modify_column(ColumnDef::new(Post::Endpoint).string().not_null()) + .modify_column(ColumnDef::new(Post::Payload).string().not_null()) + .to_owned(), + ) + .await + } +} + +/// Learn more at https://docs.rs/sea-query#iden +#[derive(Iden)] +enum AdminTrail { + Table, + Endpoint, + Payload, +} diff --git a/web3_proxy/Cargo.toml b/web3_proxy/Cargo.toml index d54f6a01..a49ddc55 100644 --- a/web3_proxy/Cargo.toml +++ b/web3_proxy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "web3_proxy" -version = "0.30.0" +version = "0.31.0" edition = "2021" default-run = "web3_proxy_cli"