Historial actualizado on conflict
This commit is contained in:
2
app.py
2
app.py
@@ -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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user