From my research, it appears that I have to manually create database
tables. I was wondering if there is a gem or something else in ROR
that would auto-create the database for me based upon my ruby model.
Thanks.
From my research, it appears that I have to manually create database
tables. I was wondering if there is a gem or something else in ROR
that would auto-create the database for me based upon my ruby model.
Thanks.
The fields themselves won’t be auto created, but when you do
./script/generate model model_name, you’ll also get a db migration file
generated for ya.
You have to manually create the empty db yourself (eg mysqladmin create
foo_development)
When you generate the model an empty migration is created in
db\migrate. Edit this to define the table columns and then run rake
db:migrate.
Read about migrations, much nicer than hand coding sql scripts.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs