text instead of string payload

This commit is contained in:
Bryan Stitt 2023-06-18 16:08:55 -07:00
parent 825ba006f1
commit 9dd0bae40a
6 changed files with 47 additions and 6 deletions

6
Cargo.lock generated

@ -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",

@ -1,6 +1,6 @@
[package]
name = "entities"
version = "0.30.0"
version = "0.31.0"
edition = "2021"
[lib]

@ -1,6 +1,6 @@
[package]
name = "migration"
version = "0.30.0"
version = "0.31.0"
edition = "2021"
publish = false

@ -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),
]
}
}

@ -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,
}

@ -1,6 +1,6 @@
[package]
name = "web3_proxy"
version = "0.30.0"
version = "0.31.0"
edition = "2021"
default-run = "web3_proxy_cli"