Hello,
I’m trying to use command rake db:migrate, but in MySQL I continuous get
an empty set and I do know why.
#/db/seeds.rb
User.create(username: “lorenz”, password: “mypass”, admin: true)
When I run:
rake db:seed RAILS_ENV=development --trace
I received:
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:abort_if_pending_migrations
and my database keep empty.
The migration is new and it works.
Thanks to all.
On 7 May 2013 11:18, Lorenz B. [email protected] wrote:
and my database keep empty.
The migration is new and it works.
What do you see if you run
rake db:migrate
Colin
Colin L. wrote in post #1108068:
On 7 May 2013 11:18, Lorenz B. [email protected] wrote:
and my database keep empty.
The migration is new and it works.
What do you see if you run
rake db:migrate
Colin
Console viewed the migration of all the tables. The application works
good and Active Record also, because I can read/write on database
thorugh console and application interface.
I’m only searching a simple way to populate database when I take the
decision to re-generate a “clean” database.
Thanks.
Colin L. wrote in post #1108191:
On 8 May 2013 08:13, Lorenz B. [email protected] wrote:
Colin
Console viewed the migration of all the tables. The application works
good and Active Record also, because I can read/write on database
thorugh console and application interface.
I’m only searching a simple way to populate database when I take the
decision to re-generate a “clean” database.
So what do you see when you run rake db:migrate? Please copy/paste
the result. Also then please run rake db:seed and copy/paste the
result here. Also paste the complete db/seeds.rb and anything added
to development.log by the running of rake db:seed. Please include the
command invocation in the pasted result.
Colin
I fixed it. I forgot to have put a validation on user and that blocked
the creation.
Thank you so much Colin for time spent to me.
On 8 May 2013 08:13, Lorenz B. [email protected] wrote:
Colin
Console viewed the migration of all the tables. The application works
good and Active Record also, because I can read/write on database
thorugh console and application interface.
I’m only searching a simple way to populate database when I take the
decision to re-generate a “clean” database.
So what do you see when you run rake db:migrate? Please copy/paste
the result. Also then please run rake db:seed and copy/paste the
result here. Also paste the complete db/seeds.rb and anything added
to development.log by the running of rake db:seed. Please include the
command invocation in the pasted result.
Colin