Skip to content

Commit

Permalink
Fix alerts.0028 migration for SQLite (#2680)
Browse files Browse the repository at this point in the history
# What this PR does

Fixes an issue with
[alerts.0028](https://github.com/grafana/oncall/blob/f77a54b518ab8f1f42e33ca43328b75fde1903b9/engine/apps/alerts/migrations/0028_drop_alertreceivechannel_restricted_at.py)
migration failing on SQLite with the following error:
`sqlite3.OperationalError: near "DROP": syntax error`.

The issue is fixed by updating the SQLite version from `3.27.2` to
`3.40.1` (SQLite `3.35.0` introduced native support for dropping columns
as per this [SO answer](https://stackoverflow.com/a/66399224)).

However, I couldn't find an easy way to independently update SQLite,
since it's bundled into Python's standard library.
Updating the Docker image to use the latest Debian stable release fixes
the issue as it already comes with SQLite `3.40.1` out of the box. So
this PR effectively bumps the Debian version from 10 to 12, and bumps
the Python version from `3.11.3` to `3.11.4`.

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
  • Loading branch information
vstpme authored Jul 28, 2023
1 parent f77a54b commit 97757f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- Fix one of the latest migrations failing on SQLite by @vadimkerr ([#2680](https://github.com/grafana/oncall/pull/2680))

## v1.3.18 (2023-07-28)

### Changed
Expand Down
4 changes: 2 additions & 2 deletions engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.3-slim-buster AS base
FROM python:3.11.4-slim-bookworm AS base

# Create a group and user to run an app
ENV APP_USER=appuser
Expand All @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y \
gcc \
libmariadb-dev \
libpq-dev \
netcat \
netcat-traditional \
curl \
bash \
git \
Expand Down

0 comments on commit 97757f5

Please sign in to comment.