Skip to content

Commit 7f288d1

Browse files
committed
update query to insert to db
1 parent dac2a49 commit 7f288d1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

backend/scraping/instagram_feed.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ def insert_event_to_db(event_data, club_ig, post_url, sim_threshold=80):
146146
return False
147147

148148
insert_query = """
149-
INSERT INTO events (club_handle, url, name, date, start_time, end_time, location)
150-
VALUES (%s, %s, %s, %s, %s, %s, %s)
149+
INSERT INTO events (
150+
club_handle, url, name, date, start_time, end_time, location, price, food, registration
151+
)
152+
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
151153
ON CONFLICT DO NOTHING;
152154
"""
153155
cur.execute(insert_query, (
@@ -158,6 +160,9 @@ def insert_event_to_db(event_data, club_ig, post_url, sim_threshold=80):
158160
event_data["start_time"],
159161
event_data["end_time"] or None,
160162
event_location,
163+
event_data.get("price", None),
164+
event_data.get("food", ""),
165+
bool(event_data.get("registration", False)),
161166
))
162167
conn.commit()
163168
logger.debug(f"Event inserted: {event_data.get('name')} from {club_ig}")

0 commit comments

Comments
 (0)