I am running: rake db:migrate, and I am getting this error. I am some
what of a beginner, and I can’t seem to understand migrations, because
I can’t fix this problem
== 2 CreateWorks: migrating
– create_table(:works)
rake aborted!
Mysql::Error: #42S01Table ‘works’ already exists: CREATE TABLE works
(id
int(11) DEFAULT NULL auto_increment PRIMARY KEY, created_at
datetime DEFAULT NULL, updated_at
datetime DEFAULT NULL)
ENGINE=InnoDB
(See full trace by running task with --trace)
The Trace is below:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== 2 CreateWorks: migrating
– create_table(:works)
rake aborted!
Mysql::Error: #42S01Table ‘works’ already exists: CREATE TABLE works
(id
int(11) DEFAULT NULL auto_increment PRIMARY KEY, created_at
datetime DEFAULT NULL, updated_at
datetime DEFAULT NULL)
ENGINE=InnoDB
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/abstract_adapter.rb:150:in log' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/mysql_adapter.rb:281:in
execute’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
connection_adapters/abstract/schema_statements.rb:104:in
create_table' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/mysql_adapter.rb:416:in
create_table’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:285:in send' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ migration.rb:285:in
method_missing’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:265:in say_with_time' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/benchmark.rb:293:in
measure’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:265:in say_with_time' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ migration.rb:281:in
method_missing’
./db/migrate//002_create_works.rb:3:in up_without_benchmarks' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ migration.rb:219:in
send’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:219:in migrate' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/benchmark.rb:293:in
measure’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:219:in migrate' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ migration.rb:348:in
migrate’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:339:in each' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ migration.rb:339:in
migrate’
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
migration.rb:307:in up' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ migration.rb:298:in
migrate’
/Library/Ruby/Gems/1.8/gems/rails-2.0.2/lib/tasks/databases.rake:85
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in call' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in
execute’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in
execute’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in
invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
synchronize’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in
invoke_with_call_chain' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in
invoke’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in
invoke_task' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in
top_level’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in each' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in
top_level’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in
top_level’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in run' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in
standard_exception_handling’
/Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in run' /Library/Ruby/Gems/1.8/gems/rake-0.8.1/bin/rake:31 /usr/bin/rake:19:in
load’
/usr/bin/rake:19