Historial actualizado on conflict

This commit is contained in:
2024-09-09 21:49:32 +00:00
parent 67f7a72a02
commit 9bbaeab1ef

2
app.py
View File

@@ -45,7 +45,7 @@ def extract(username: str, password: str):
insert_query = """ insert_query = """
INSERT INTO public.alumno_extraccion ("Usuario_claveULSA", datos_html, materias_html, historial_html, materias_actuales_html) VALUES (%s, TRIM(%s), TRIM(%s), TRIM(%s)::JSONB, TRIM(%s)) INSERT INTO public.alumno_extraccion ("Usuario_claveULSA", datos_html, materias_html, historial_html, materias_actuales_html) VALUES (%s, TRIM(%s), TRIM(%s), TRIM(%s)::JSONB, TRIM(%s))
ON CONFLICT ("Usuario_claveULSA") DO UPDATE SET datos_html = EXCLUDED.datos_html, materias_html = EXCLUDED.materias_html, error_message = NULL, registrado = DEFAULT; ON CONFLICT ("Usuario_claveULSA") DO UPDATE SET datos_html = EXCLUDED.datos_html, materias_html = EXCLUDED.materias_html, error_message = NULL, registrado = DEFAULT, historial_html = EXCLUDED.historial_html;
""" """
cur.execute(insert_query, (username_integer, datos_html, materias_html, historial_html, materias_actuales_html)) cur.execute(insert_query, (username_integer, datos_html, materias_html, historial_html, materias_actuales_html))