If you have already executed the migrations and you want to add the column, you can do it through another migration; for example:
rails generate migration AddEdadToNegociaciones edad:integer
What will generate a new migration with the following content:
class AddEdadToNegocaciones < ActiveRecord::Migration[5.1]
def change
add_column :negocaciones, :edad, :integer
end
end
Now you should only execute your migrations again:
$ rails db:migrate
If you do not want to generate a new migration and you prefer to update the one generated by the scaffold , you can do it but you will first have to do a rollback so you can detect the change:
$ rails db:rollback
After the rollback update the migration:
class CreateNegociaciones < ActiveRecord::Migration[5.1]
def change
create_table :negociaciones do |t|
t.string :nombre
t.string :apellidos
t.integer :edad
t.timestamps
end
end
end
And, finally, execute the migrations again:
$ rails db:migrate