fix: i64
This commit is contained in:
parent
6c378818fb
commit
08d29f6da1
1 changed files with 6 additions and 4 deletions
|
@ -62,7 +62,7 @@ impl Initializer {
|
||||||
pub(crate) async fn setup(
|
pub(crate) async fn setup(
|
||||||
&self,
|
&self,
|
||||||
threads: u32,
|
threads: u32,
|
||||||
skip: u64,
|
skip: i64,
|
||||||
since: Option<String>,
|
since: Option<String>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
println!("Several tables in PostgreSQL are going to be moved to ScyllaDB.");
|
println!("Several tables in PostgreSQL are going to be moved to ScyllaDB.");
|
||||||
|
@ -152,12 +152,14 @@ impl Initializer {
|
||||||
num_notes = num_notes.filter(note::Column::Id.gt(&since));
|
num_notes = num_notes.filter(note::Column::Id.gt(&since));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut num_notes: u64 = num_notes.select_only().column_as(note::Column::Id.count(), "count")
|
let mut num_notes: i64 = num_notes
|
||||||
|
.select_only()
|
||||||
|
.column_as(note::Column::Id.count(), "count")
|
||||||
.into_tuple()
|
.into_tuple()
|
||||||
.one(&db)
|
.one(&db)
|
||||||
.await?
|
.await?
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
num_notes -= note_skip;
|
num_notes -= note_skip as i64;
|
||||||
println!("Posts: {num_notes}");
|
println!("Posts: {num_notes}");
|
||||||
let num_reactions: i64 = note_reaction::Entity::find()
|
let num_reactions: i64 = note_reaction::Entity::find()
|
||||||
.select_only()
|
.select_only()
|
||||||
|
@ -220,7 +222,7 @@ impl Initializer {
|
||||||
}
|
}
|
||||||
let mut notes = notes.stream(&db).await?;
|
let mut notes = notes.stream(&db).await?;
|
||||||
|
|
||||||
let mut copied: u64 = 0;
|
let mut copied: i64 = 0;
|
||||||
|
|
||||||
while let Some(note) = notes.try_next().await? {
|
while let Some(note) = notes.try_next().await? {
|
||||||
copied += 1;
|
copied += 1;
|
||||||
|
|
Loading…
Reference in a new issue