aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fietsboek/updater/scripts/upd_20230103_lu8w3rwlz4ddcpms.py3
-rw-r--r--fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/fietsboek/updater/scripts/upd_20230103_lu8w3rwlz4ddcpms.py b/fietsboek/updater/scripts/upd_20230103_lu8w3rwlz4ddcpms.py
index 1630fbb..4362c2d 100644
--- a/fietsboek/updater/scripts/upd_20230103_lu8w3rwlz4ddcpms.py
+++ b/fietsboek/updater/scripts/upd_20230103_lu8w3rwlz4ddcpms.py
@@ -15,6 +15,7 @@ from pathlib import Path
import brotli
import gpxpy
from sqlalchemy import create_engine
+from sqlalchemy.sql import text
from fietsboek.updater.script import UpdateScript
@@ -37,7 +38,7 @@ class Up(UpdateScript):
"FROM tracks, users "
"WHERE tracks.owner_id = users.id;"
)
- for row in connection.execute(sql):
+ for row in connection.execute(text(sql)):
track_id, title, description, date_raw, date_tz, author_name = row
if isinstance(date_raw, str):
date_raw = datetime.datetime.strptime(date_raw, "%Y-%m-%d %H:%M:%S.%f")
diff --git a/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py b/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py
index 31ee9a0..e900c7a 100644
--- a/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py
+++ b/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py
@@ -28,7 +28,7 @@ class Up(UpdateScript):
connection = engine.connect()
data_dir = Path(config["fietsboek.data_dir"])
- for row in connection.execute("SELECT id, gpx FROM tracks;"):
+ for row in connection.execute(text("SELECT id, gpx FROM tracks;")):
self.tell(f"Moving GPX data for track {row.id} from database to disk")
track_dir = data_dir / "tracks" / str(row.id)
track_dir.mkdir(parents=True, exist_ok=True)