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(
12491249 Ok ( ( ) )
12501250}
12511251
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 > {
12581254 use subgraph_deployment as d;
12591255
1260- let full_count_query = format ! ( "({})" , full_count_query) ;
12611256 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 ) ) )
12631258 . execute ( conn) ?;
12641259 Ok ( ( ) )
12651260}
Original file line number Diff line number Diff line change @@ -1313,7 +1313,7 @@ impl DeploymentStore {
13131313
13141314 let event = if truncate {
13151315 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 ( ) ) ?;
13171317 event
13181318 } else {
13191319 let ( event, count) = layout. revert_block ( conn, block) ?;
You can’t perform that action at this time.
0 commit comments