I am looking for ways to write migrations in rails that can be executed against the database many times without failing.
For instance let say I have this migration:
This should work
def self.table_exists?(name) ActiveRecord::Base.connection.tables.include?(name) end if table_exists?(:profile) && !Profile.column_names.include?("url") add_column :profile, :url, :string end