Commit 6d3af9d
fix(migrations): Skip pg_dumpall restrict/unrestrict tokens in drift check (#112777)
PostgreSQL 16+ added `\restrict` / `\unrestrict` directives to
`pg_dumpall` output. These carry random per-session tokens for password
scrambling and are not part of the database schema.
The migration drift CI job runs `pg_dumpall` twice (once after
sequential migrations, once after squashed migrations) and compares the
output. Since the tokens are regenerated on every dump, the comparison
always reports a false-positive diff — causing the `migrations-drift`
workflow to fail on every PR that touches migrations, in both sentry and
getsentry.
This filters out `\restrict` and `\unrestrict` lines in the `norm()`
function, alongside the existing filters for comments and
`django_migrations` tables. The `quick_drift_compare.py` script
delegates to the same compare module, so both code paths are fixed.
Example of the spurious diff this eliminates:
```
-\restrict chSRsrfaJ6ZjA7ck8dSaajbhnPiwOqTaC6ldxf7bN2kbn4VJZk4ODoz8l0XL2pk
+\restrict dXbwY4tgrWq0glKas9UkhhnydrGduwSqaYnQMvQj53fxjnB36DA9XvXg3TMMG9U
```
Co-authored-by: Claude Opus 4 <noreply@anthropic.com>1 parent db8e93c commit 6d3af9d
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
0 commit comments