diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-12-15 22:44:24 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-12-15 22:44:24 +0100 |
commit | 262b7d43a34af8ca6097b2e1874e6eb8ffefe185 (patch) | |
tree | 7bfb439c554de3d8bd2a606950474e2515cbed58 | |
parent | 61b93a8a117dcbe1b4a0e72363936cf0b83c571e (diff) | |
download | fietsboek-262b7d43a34af8ca6097b2e1874e6eb8ffefe185.tar.gz fietsboek-262b7d43a34af8ca6097b2e1874e6eb8ffefe185.tar.bz2 fietsboek-262b7d43a34af8ca6097b2e1874e6eb8ffefe185.zip |
actually downgrade revision on update downgrade
-rw-r--r-- | fietsboek/updater/__init__.py | 2 | ||||
-rw-r--r-- | fietsboek/updater/scripts/upd_30ppwg8zi4ujb46f.py | 3 |
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 ) |