Adds a new validation that warns when a remove_column migration is run without providing a column type.
Bad (rails raises this error when attempting a rollback):
class RemovePublishedFromPosts < ActiveRecord::Migration
def change
remove_column :posts, :published
end
end
Good:
class RemovePublishedFromPosts < ActiveRecord::Migration
def change
remove_column :posts, :published, :boolean
end
end
Note that this branch only checks for database-agnostic types listed in the Rails API docs. I'm open to also including types specific to Postgres, MySQL, and SQLite, so that users of the most common DBs don't get extraneous errors from this gem. The guides have an official page for Postgres types -- I don't see a corresponding one for MySQL or SQLite, but can try to hunt down an official types list for each of those if you think that's a reasonable next step.
Adds a new validation that warns when a
remove_column
migration is run without providing a column type.Bad (rails raises this error when attempting a rollback):
Good:
Note that this branch only checks for database-agnostic types listed in the Rails API docs. I'm open to also including types specific to Postgres, MySQL, and SQLite, so that users of the most common DBs don't get extraneous errors from this gem. The guides have an official page for Postgres types -- I don't see a corresponding one for MySQL or SQLite, but can try to hunt down an official types list for each of those if you think that's a reasonable next step.