I am trying to remove a column from my database. I'm running this
rails generate RemoveOccupancyFromSpaces occupancy:string
But then am getting this error message
Could not find generator 'RemoveOccupancyFromSpaces'. Maybe you meant 'resource_route' or 'devise:controllers' or 'active_admin:page'
Run `rails generate --help` for more options.
Where am I going wrong here?
The correct syntax is rails generate migration RemoveOccupancyFromSpaces occupancy:string
This should yield a file with the correct syntax:
class RemoveOccupancyFromSpaces < ActiveRecord::Migration
def change
remove_column :spaces, :occupancy, :string
end
end