开发者

What's wrong with this ruby on rails migration?

开发者 https://www.devze.com 2023-01-19 23:23 出处:网络
I am trying to migrate ruby on rails application from one machine to another and when I type Rak开发者_Python百科e db:migrate it gives following error:

I am trying to migrate ruby on rails application from one machine to another and when I type Rak开发者_Python百科e db:migrate it gives following error:

Mysql::Error: Table 'schema_migrations' already exists:
CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB

what might be the possible cause..?


As mentioned by Bohdan...

or

rake db:migrate:reset


Hi try rake db:drop rake db:create rake db:migrate


In my case just dropping and creating database didn't help. Try restarting mysql server also:

/etc/init.d/mysqld restart
/etc/init.d/mysql restart
service mysqld restart

(depending on what OS you run), and then:

rake db:reset && rake db:test:clone

P.S. If you're using any preloaded like zeus or guard, try running without it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号