On Fri, Feb 10, 2012 at 1:56 AM, Felipe Pieretti Umpierre <
[email protected]> wrote:
> felipe@Felipe:~/rails_projects/mailler$ bundle exec rake db:create
> mailler_development already exists
>
So, your db exists and is reachable.
> rake aborted!
> Mysql::Error: Access denied for user 'mailler'@'localhost' to database
> 'mailler_test': CREATE DATABASE `mailler_test` DEFAULT CHARACTER SET
> `utf8` COLLATE `utf8_unicode_ci`
>
> Tasks: TOP => db:create
> (See full trace by running task with --trace)
>
Don't worry about this yet (you have not configured
the database.yml "test" section yest, you can do that later).
> felipe@Felipe:~/rails_projects/mailler$ bundle exec rake db:migrate
>
So, this probably means that all required migrations have been run.
It only runs _new_ migrations that are not yet in the database.
To see "something" moving ... you could do something like this:
$ bundle exec rails generate model Foo name:string # generates a new model
with it's migration
invoke active_record
create db/migrate/20120210082759_create_foos.rb
create app/models/foo.rb
invoke rspec
create spec/models/foo_spec.rb
invoke factory_girl
create spec/factories/foos.rb
$ bundle exec rake db:migrate # now there is 1 new migration that needs to
run
== CreateFoos: migrating
=====================================================
-- create_table(:foos)
NOTICE: CREATE TABLE will create implicit sequence "foos_id_seq" for
serial column "foos.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foos_pkey"
for table "foos"
-> 0.0299s
== CreateFoos: migrated (0.0300s)
============================================
$ bundle exec rake db:rollback # rolling that back if yoiu don't need it
== CreateFoos: reverting
=====================================================
-- drop_table("foos")
-> 0.0019s
== CreateFoos: reverted (0.0020s)
============================================
$ bundle exec rails destroy model Foo name:string # removing that Foo test
model from the code also
invoke active_record
remove db/migrate/20120210082759_create_foos.rb
remove app/models/foo.rb
invoke rspec
remove spec/models/foo_spec.rb
invoke factory_girl
remove spec/factories/foos.rb
HTH,
Peter
--
*** Available for a new project ***
Peter Vandenabeele
http://twitter.com/peter_v
http://rails.vandenabeele.com
http://coderwall.com/peter_v
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.