Skip to content

Commit

Permalink
clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Feb 5, 2024
1 parent 126b579 commit df12d93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
1 change: 0 additions & 1 deletion store/postgres/src/connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,6 @@ fn migrate_schema(logger: &Logger, conn: &mut PgConnection) -> Result<MigrationC
let mut harness = HarnessWithOutput::new(conn, &mut output);

info!(logger, "Running migrations");
// let result = conn.run_pending_migrations(MIGRATIONS);
let result = harness.run_pending_migrations(MIGRATIONS);
info!(logger, "Migrations finished");

Expand Down
19 changes: 2 additions & 17 deletions store/postgres/src/deployment_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ impl DeploymentStore {
&self,
namespace: &crate::primary::Namespace,
) -> Result<(), StoreError> {
let conn = &mut *self.get_conn()?;
deployment::drop_schema(conn, namespace)
let mut conn = self.get_conn()?;
deployment::drop_schema(&mut conn, namespace)
}

// Only used for tests
Expand Down Expand Up @@ -1412,21 +1412,6 @@ impl DeploymentStore {
}
}

// Don't revert past a graft point
let info = self.subgraph_info_with_conn(&mut conn, site.as_ref())?;
if let Some(graft_block) = info.graft_block {
if graft_block > block_ptr_to.number {
return Err(constraint_violation!(
"Can not revert subgraph `{}` to block {} as it was \
grafted at block {} and reverting past a graft point \
is not possible",
site.deployment.clone(),
block_ptr_to.number,
graft_block
));
}
}

self.rewind_or_truncate_with_conn(&mut conn, site, block_ptr_to, firehose_cursor, false)
}

Expand Down
2 changes: 1 addition & 1 deletion store/postgres/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ impl<'a> Connection<'a> {
.filter(a::node_id.eq_any(&nodes))
.select((a::node_id, sql::<BigInt>("count(*)")))
.group_by(a::node_id)
.order_by(sql::<Integer>("count(*)"))
.order_by(sql::<BigInt>("count(*)"))
.load::<(String, i64)>(self.conn.as_mut())?;

// Any nodes without assignments will be missing from `assigned`
Expand Down

0 comments on commit df12d93

Please sign in to comment.