Ignore columns rule doesn't warn you about multiple columns in a migration to drop more than one
lake-effect opened this issue · comments
Ashley Lake commented
Steps to reproduce
- Write a migration in Rails and create a table with 3 or more columns
- Include strong_migrations in your application config appropriately
- Write a migration dropping 2 of those columns the usual way: 2 invocations of
remove_column, :column_name
in the migration - Run the migration
- Observe that strong_migrations only warns you about ignoring the first column
Expected behavior
Step 5 should mention both columns being dropped.
Environment
- strong_migrations 1.3.2
- rails 7.0.4.3
Andrew Kane commented
Hi @lake-effect, Strong Migrations errors on the first unsafe statement it encounters, so it doesn't know about future statements. Other approaches like parsing the migration file could probably detect this, but I don't think it's worth changing approaches.
Ashley Lake commented
That makes sense. Maybe an effective thing to do in that case is add a notice in the output like Re-run the migration after making the recommended changes to detect other issues.