getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.22k stars 4.21k forks source link

feat(migrations): Add in `SafeDeleteColumn` migration operation #81098

Open wedamija opened 22 hours ago

wedamija commented 22 hours ago

This builds on https://github.com/getsentry/sentry/pull/81063

This adds in SafeDeleteColumn, which works the same way as SafeDeleteModel, except on database columns.

It performs checks that the column doesn't have a db constraint set, and also that it is either nullable or has a db_default set.

Similarly to SafeDeleteModel we still need to be careful to make sure that the pending deletion merges and deploys first, and then the real deletion.

wedamija commented 22 hours ago

Note that this pr looks huge, but it's mostly just boilerplate from tests. I recommend marking all the tests viewed to focus on the core changes