Skip to content

Commit

Permalink
(PC-29941)[API] script: delete venues from google_places_info if comm…
Browse files Browse the repository at this point in the history
…on_name not equal name
  • Loading branch information
abdelmoujibMegzari committed Jun 26, 2024
1 parent 3388142 commit 8e6a152
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from pcapi.core.offerers import models as offerer_models
from pcapi.models import db


for google_place_info_entry_to_delete in (
offerer_models.GooglePlacesInfo.query.join(offerer_models.Venue)
.filter(offerer_models.Venue.common_name != offerer_models.Venue.name)
.with_entities(offerer_models.GooglePlacesInfo)
.yield_per(100)
):
db.session.delete(google_place_info_entry_to_delete)
db.session.commit()

0 comments on commit 8e6a152

Please sign in to comment.