Ruby on Rails Thursday, October 30, 2014

On 30 October 2014 16:11, K.S. Koushik <koushik.rjn@gmail.com> wrote:
>
> This is the ruby code of the migration.
>
> (class CreateUsers < ActiveRecord::Migration
> def up
> create_table :users do |t|
> t.string "first_name",:limit =>25
> t.string "last_name", :limit =>50
> t.string "email",:default => "",:null => false
> t.string "password",:limit => 40
> t.timestamps
> end
> def down
> drop_table :users
> end
> end
> end)
> The terminal command
>
> (rake db:migrate VERSION=0)
>
> But i am still able to see the users table after running that terminal
> command. It says reverting CreateUsers but does not drop the table.
> Any help?

You have def down inside def up. It needs to be between the last two
end statements.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvGgCptViSJ-%3DS_y0FOG_dkdDMhEkk9GX5-63oJ8%3D7JyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment