Skip to content

Commit 7f3a0c7

Browse files
fix(migrations): kpi migration script failure on fresh installs DEV-1305 (#6485)
### 👀 Preview steps 1. ℹ️ create a fresh kobo install 2. 🔴 [on main] receive an error when applying migrations: ``` psycopg.errors.UndefinedTable: relation "django_migrations" does not exist LINE 1: SELECT * FROM django_migrations WHERE app = 'mfa' AND name =... ``` 3. 🟢 [on PR] migrations will all apply and app will build successfully 4. Create a user with MFA availabilities 5. 🟢 User will be able to authenticate with MFA Co-authored-by: Olivier Léger <[email protected]>
1 parent 14673b8 commit 7f3a0c7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scripts/__init__.py

Whitespace-only changes.

scripts/fix_migrations_for_kpi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
from django.conf import settings
2-
from django.db import connection, connections
1+
from django.db import connection
2+
3+
from .fix_migrations_for_kobocat import are_migration_already_applied
34

45

56
def run():
7+
8+
if not are_migration_already_applied():
9+
return
10+
611
if should_fix_internal_mfa_app_label():
712
fix_internal_mfa_app_label()
813

0 commit comments

Comments
 (0)