avram
                                
                                 avram copied to clipboard
                                
                                    avram copied to clipboard
                            
                            
                            
                        migrations: incorrectly attempting `drop :column` tries to drop a table with that name
In a migration I just tried this:
  def rollback
    alter :domains do
      drop :verification_token
      drop :verification_status
    end
  end
And was greeted with this very confusing error message, which makes it seem like if I had a table called verification_token it might have been accidentally deleted. 👻
Error occurred while performing a migration.
Migration: AddDomainVerificationField::V20221007223200
Statements:
  DROP TABLE verification_token
DROP TABLE verification_status (Avram::FailedMigration)
I think to fix this, we should make table_for return some sort of object that alter, create, and drop all expect. So we remove the ability to pass Symbol to these. Then if you pass a symbol, we can raise an error that's like "yeah, you don't want to do that".
Does it even make sense to be able to call drop from within an alter_table block?
alter is a macro, but drop is a method, so I'm not sure if there would be a way to detect that drop was even called in an alter block :thinking:
https://github.com/luckyframework/avram/blob/9c8caecf052641d15dbe027e0cafb1741d8af33f/src/avram/migrator/statement_helpers.cr#L23
Please don't require table_for 🙏 I don't like using it.