r/Database • • 14h ago

Our permissions migration passed its own checks. A full row compare still found 1 role seeing too much in prod

0 Upvotes

A migration rewrote the permission matrix of a multi-tenant app. It applied clean and its own probes passed.

Then we compared every row of the permissions table in prod against the local database where the matrix had been proven. One cell was off. A restricted role already had a grant to see its peers' records, live, from before this task even started. The migration never touched that row, so its checks never looked at it.

Since then the check after deploy compares the whole table against the proven copy, not only the rows the migration wrote.