Skip to content

Commit 9b70457

Browse files
authored
Clarify when migration tests are necessary (#14023)
1 parent c3e133f commit 9b70457

File tree

1 file changed

+3
-2
lines changed
  • develop-docs/backend/application-domains/database-migrations

1 file changed

+3
-2
lines changed

develop-docs/backend/application-domains/database-migrations/index.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ There are some things we need to be careful about when running migrations.
7676

7777
### Testing
7878

79-
Database migrations are risky operations that can lead to irreversible data loss or corruption. This is especially true for [data migrations](https://docs.djangoproject.com/en/4.0/topics/migrations/#data-migrations).
80-
For this reason, every migration should have a corresponding integration test.
79+
Note: Regular migrations that modify table structure don't need migration tests
80+
81+
[Data migrations](https://docs.djangoproject.com/en/4.0/topics/migrations/#data-migrations) are particularly risky, since they operate on data and can lead to irreversible data loss or corruption. For this reason, every data migration should have a corresponding integration test.
8182

8283
To test your migration, derive a test case from `TestMigrations` and add it to `tests/sentry/migrations`.
8384
For example:

0 commit comments

Comments
 (0)