Skip to content

Commit 86ca438

Browse files
authored
fix: address django migration failing on SQLite (#5308)
## Which issue(s) this PR closes Fixes #5306 (and related to #5244 (comment)) + add CI check to avoid this from happening in the future ## 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] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
1 parent 4826291 commit 86ca438

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

.github/workflows/linting-and-tests.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,15 @@ jobs:
190190
uses: actions/checkout@v4
191191
- name: Setup Python
192192
uses: ./.github/actions/setup-python
193+
- name: Wait for MySQL to be ready
194+
working-directory: engine
195+
run: ./wait_for_test_mysql_start.sh
196+
- name: Test Django migrations work from blank slate
197+
working-directory: engine
198+
run: python manage.py migrate
193199
- name: Unit Test Backend
194200
working-directory: engine
195-
run: ./wait_for_test_mysql_start.sh && pytest -x
201+
run: pytest -x
196202

197203
unit-test-backend-postgresql-rabbitmq:
198204
name: "Backend Tests: PostgreSQL + RabbitMQ (RBAC enabled: ${{ matrix.rbac_enabled }})"
@@ -229,6 +235,9 @@ jobs:
229235
uses: actions/checkout@v4
230236
- name: Setup Python
231237
uses: ./.github/actions/setup-python
238+
- name: Test Django migrations work from blank slate
239+
working-directory: engine
240+
run: python manage.py migrate
232241
- name: Unit Test Backend
233242
working-directory: engine
234243
run: pytest -x
@@ -259,6 +268,9 @@ jobs:
259268
uses: actions/checkout@v4
260269
- name: Setup Python
261270
uses: ./.github/actions/setup-python
271+
- name: Test Django migrations work from blank slate
272+
working-directory: engine
273+
run: python manage.py migrate
262274
- name: Unit Test Backend
263275
working-directory: engine
264276
run: pytest -x
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generated by Django 4.2.16 on 2024-11-20 20:23
22

3-
import common.migrations.remove_field
4-
import django_migration_linter as linter
3+
# import common.migrations.remove_field
4+
# import django_migration_linter as linter
55
from django.db import migrations
66

77

@@ -12,10 +12,14 @@ class Migration(migrations.Migration):
1212
]
1313

1414
operations = [
15-
linter.IgnoreMigration(),
16-
common.migrations.remove_field.RemoveFieldDB(
17-
model_name='resolutionnoteslackmessage',
18-
name='_slack_channel_id',
19-
remove_state_migration=('alerts', '0068_remove_resolutionnoteslackmessage__slack_channel_id_state'),
20-
),
15+
# NOTE: commented out due to some issues this was causing w/ SQLite:
16+
# https://github.com/grafana/oncall/issues/5306
17+
# https://github.com/grafana/oncall/issues/5244#issuecomment-2503999986
18+
#
19+
# linter.IgnoreMigration(),
20+
# common.migrations.remove_field.RemoveFieldDB(
21+
# model_name='resolutionnoteslackmessage',
22+
# name='_slack_channel_id',
23+
# remove_state_migration=('alerts', '0068_remove_resolutionnoteslackmessage__slack_channel_id_state'),
24+
# ),
2125
]

0 commit comments

Comments
 (0)