Skip to content

Consolidate database cleaner code for migrations

Stan Hu requested to merge sh-consolidate-migration-delete into master

What does this MR do and why?

Previously we had two config.around(:each, :migration) blocks that disabled and re-enabled transactional tests. However, the delete_from_all_tables! call made in the outer block may initiate a transaction as a result.

To avoid this and clear up confusion, we consolidate delete_from_all_tables! in one place.

I attempted to do something similar in !101613 (merged) but reverted this change in !101824 (merged) due to issues with schema versions not being consistent. !101824 (merged) likely solved the root issue by forcing a refresh of attribute methods.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports