[英]only using development mysql db, not test or production in rails
I've created a new rails app (3.1.1) using MySQL. 我使用MySQL创建了一个新的Rails应用程序(3.1.1)。 In database.yml, I've put in the login credentials for a remote MySQL server in development, while the test & production databases are set up with localhost.
在database.yml中,我已输入正在开发中的远程MySQL服务器的登录凭据,而测试和生产数据库是使用localhost设置的。 It appears that creating a scaffold and rake db:migrate goes into the test db?
看来创建脚手架并耙db:migrate进入了测试数据库?
How do I do force rails to only use development mysql db? 如何强制Rails仅使用开发mysql数据库? I'd like db:create, db:migrate, etc. only create tables in the development (remote MySQL) server and NOT in test or production?
我想要db:create,db:migrate等。仅在开发(远程MySQL)服务器中创建表,而不在测试或生产中创建表?
rake db:migrate
and similar calls use your development
environment, not your test one. rake db:migrate
和类似的调用使用你的development
环境,而不是你的测试环境。 If you want to migrate your test database, you would do 如果要迁移测试数据库,则可以
rake RAILS_ENV=test db:migrate
How are you determining that when you use rake db:migrate
that this is going into your test DB? 你如何确定当你使用
rake db:migrate
,这会进入你的测试数据库?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.