Specify only the model and delete it as shown below.
Terminal
rails destroy model [Model name]
This is the command because you don't need to specify any columns when you drop the model.
However, if you have done rails db: migrate
, you have created a table, so you should delete the table just in case.
Change the part of create_table: comments
to drop_table: comments
.
class CreateComments < ActiveRecord::Migration[6.0]
def change
create_table :comments do |t|
t.string :content
end
end
Finally, type the following command in the terminal to delete the table from the data veil.
rails db:migrate