-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth-bytecode-db-extractors - extract job queue #652
base: main
Are you sure you want to change the base?
eth-bytecode-db-extractors - extract job queue #652
Conversation
… with extracted job-queue
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 | ||
|
||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "seaql_migrations")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub version: String, | ||
pub applied_at: i64, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation {} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove useless codegen?
create_extension_pgcrypto, | ||
create_function_job_queue_set_modified_at, | ||
create_enum_job_status, | ||
create_table_job_queue, | ||
create_index_job_queue_status, | ||
create_trigger_job_queue_set_modified_at, | ||
create_function_insert_job, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh, I don't like the idea that you declare 7 variables and then copypaste them here. if you miss some variable or write it twice, compiler wont tell you and it will be hard to spot the mistake.
Maybe write them inside &[]
and add -- sql comment
if you need some kind of names for your sql statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same problem with fn down()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I see that you use the same approach in blockscout-migration
... okay, then we can leave it as it is for consistency :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is that you cannot put a single string with several sql statements into Statement::from_string
. Usually we are using from_sql
method for that cases that internally split all statements based on ';'. But in functions we use ";" internally and thus, the approach with splitting cannot be applied here. That is why we need a separate statements
Extracts job queue related functionality into a separate crate, so that it could be reused between different extractors