hao min wrote:
I created a model and specify the columns in the database table. But
when I use “rake db:migrate” to migrate the database table. It keeps
igoring the command. (but not Aborted) it just does not give any result,
and the table was not created in the database.
When I tried it in another project folder and did exactly the same
thing, it worked. It just does not work in that specific project.
Does anyone know what the problem is? Thanks for help.
I think you may be confused about migration. If you “specify the
columns in the database table” then you are not using migrations.
“rake db:migrate” makes sure your database is up to date by executing
the files in db/migrations/xxx_create_some_table.rb
ruby script/generate model SomeModel
ruby script/generate migration AddFooToBars
Edit the new file in db/migrations that was just created.
Now run “rake db:migrate” The database changes you just defined
should be applied to your database.