Skip to content

Commit e5b905f

Browse files
wedamijac298lee
authored andcommitted
fix(migrations): Fix generate migration step to work in new Django apps. (#77220)
This fixes the generate sql command to work correctly in new Django apps. It works by performing a diff of any new files in the migration folders compared to master. In a new app, this ends up including `__init__.py`, which causes the command to fail. Just excluding that file. <!-- Describe your PR here. -->
1 parent b25d53a commit e5b905f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
id: file
6969
run: |
7070
echo 'added<<EOF' >> "$GITHUB_OUTPUT"
71-
git diff --diff-filter=A --name-only origin/master HEAD -- 'src/sentry/*/migrations/*' 'src/sentry/migrations/*' >> "$GITHUB_OUTPUT"
71+
git diff --diff-filter=A --name-only origin/master HEAD -- 'src/sentry/*/migrations/*' 'src/sentry/migrations/*' | grep -v "__init__.py" >> "$GITHUB_OUTPUT"
7272
echo 'EOF' >> "$GITHUB_OUTPUT"
7373
7474
- name: Generate SQL for migration

0 commit comments

Comments
 (0)