I use
rails generate model mynewmodel string:name string:description
to generate a new model. How do I deploy this new model to my develop databse ? I already have a bunch of databases in my sqlite db.
I have tried
rake db:migrate
it seemed having trouble to generate this new table in db.
update: added error message
== CreateMynewmodels: migrating ===============================================
-- create_table(:mynewmodels)
rake aborted!
An error has occurred, this and all later migrations canceled:
undefined method `name' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x3ad5c50>
Tasks: TOP => db:migrate
Thanks
The order of your fieldname:type combo is incorrect. Try
rails generate model mynewmodel name:string description:string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With