File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -1249,17 +1249,12 @@ pub fn update_entity_count(
1249
1249
Ok ( ( ) )
1250
1250
}
1251
1251
1252
- /// Set the deployment's entity count to whatever `full_count_query` produces
1253
- pub fn set_entity_count (
1254
- conn : & mut PgConnection ,
1255
- site : & Site ,
1256
- full_count_query : & str ,
1257
- ) -> Result < ( ) , StoreError > {
1252
+ /// Set the deployment's entity count back to `0`
1253
+ pub fn clear_entity_count ( conn : & mut PgConnection , site : & Site ) -> Result < ( ) , StoreError > {
1258
1254
use subgraph_deployment as d;
1259
1255
1260
- let full_count_query = format ! ( "({})" , full_count_query) ;
1261
1256
update ( d:: table. filter ( d:: id. eq ( site. id ) ) )
1262
- . set ( d:: entity_count. eq ( sql ( & full_count_query ) ) )
1257
+ . set ( d:: entity_count. eq ( BigDecimal :: from ( 0 ) ) )
1263
1258
. execute ( conn) ?;
1264
1259
Ok ( ( ) )
1265
1260
}
Original file line number Diff line number Diff line change @@ -1313,7 +1313,7 @@ impl DeploymentStore {
1313
1313
1314
1314
let event = if truncate {
1315
1315
let event = layout. truncate_tables ( conn) ?;
1316
- deployment:: set_entity_count ( conn, site. as_ref ( ) , layout . count_query . as_str ( ) ) ?;
1316
+ deployment:: clear_entity_count ( conn, site. as_ref ( ) ) ?;
1317
1317
event
1318
1318
} else {
1319
1319
let ( event, count) = layout. revert_block ( conn, block) ?;
You can’t perform that action at this time.
0 commit comments