cargo clippy

This commit is contained in:
Bryan Stitt 2023-04-05 14:48:48 -07:00
parent e90175c638
commit 66471e29df

View File

@ -6,12 +6,11 @@ pub struct Migration;
#[async_trait::async_trait] #[async_trait::async_trait]
impl MigrationTrait for Migration { impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
// Add a nullable timestamp column to check if things were migrated in the rpc_accounting table .. // Add a nullable timestamp column to check if things were migrated in the rpc_accounting table
manager manager
.alter_table( .alter_table(
Table::alter() Table::alter()
.table(RpcAccounting::Table) .table(RpcAccounting::Table)
.to_owned()
.add_column(ColumnDef::new(RpcAccounting::Migrated).timestamp()) .add_column(ColumnDef::new(RpcAccounting::Migrated).timestamp())
.to_owned(), .to_owned(),
) )
@ -30,48 +29,9 @@ impl MigrationTrait for Migration {
} }
} }
/// Learn more at https://docs.rs/sea-query#iden /// partial table for RpcAccounting
#[derive(Iden)]
pub enum UserKeys {
Table,
Id,
}
#[derive(Iden)] #[derive(Iden)]
enum RpcAccounting { enum RpcAccounting {
Table, Table,
Id,
UserKeyId,
ChainId,
Method,
ErrorResponse,
PeriodDatetime,
FrontendRequests,
BackendRequests,
BackendRetries,
NoServers,
CacheMisses,
CacheHits,
SumRequestBytes,
MinRequestBytes,
MeanRequestBytes,
P50RequestBytes,
P90RequestBytes,
P99RequestBytes,
MaxRequestBytes,
SumResponseMillis,
MinResponseMillis,
MeanResponseMillis,
P50ResponseMillis,
P90ResponseMillis,
P99ResponseMillis,
MaxResponseMillis,
SumResponseBytes,
MinResponseBytes,
MeanResponseBytes,
P50ResponseBytes,
P90ResponseBytes,
P99ResponseBytes,
MaxResponseBytes,
Migrated, Migrated,
} }