aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fietsboek/updater/__init__.py2
-rw-r--r--fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/fietsboek/updater/__init__.py b/fietsboek/updater/__init__.py
index 348f713..3611e9f 100644
--- a/fietsboek/updater/__init__.py
+++ b/fietsboek/updater/__init__.py
@@ -356,7 +356,7 @@ class UpdateScript:
LOGGER.info("[down] Running pre-alembic task for %s", self.id)
self.module.Down().pre_alembic(config)
LOGGER.info("[down] Running alembic downgrade for %s to %s", self.id, self.alembic_version)
- alembic.command.downgrade(alembic_config, self.alembic_version)
+ alembic.command.downgrade(alembic_config, "-1")
LOGGER.info("[down] Running post-alembic task for %s", self.id)
self.module.Down().post_alembic(config)
diff --git a/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py b/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py
index f620289..983ea45 100644
--- a/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py
+++ b/fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py
@@ -12,6 +12,7 @@ import gzip
import brotli
from pathlib import Path
from sqlalchemy import create_engine
+from sqlalchemy.sql import text
update_id = '30ppwg8zi4ujb46f'
previous = [
@@ -55,7 +56,7 @@ class Down(UpdateScript):
brotli_data = (track_path / "track.gpx.br").read_bytes()
gzip_data = gzip.compress(brotli.decompress(brotli_data))
connection.execute(
- "UPDATE tracks SET gpx = :gpx WHERE id = :id;",
+ text("UPDATE tracks SET gpx = :gpx WHERE id = :id;"),
gpx=gzip_data, id=track_id
)