简体   繁体   English

只使用开发mysql db,而不是在rails中测试或生产

[英]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.

相关问题 如何使用AWS开发工具包将Production Mysql db还原到Development Mysql db - How to restore Production Mysql db to development Mysql db using AWS SDK Rails测试db比开发db快10倍 - Rails test db 10x faster than development db Rails .where对数据库的调用显示开发中的图像(mysql),但不显示生产中的图像(postgres) - Rails .where call to database shows images in development (mysql), but not production (postgres) 如何仅将 Mysql 数据库结构从开发服务器复制到生产服务器(生产服务器有数据,而开发服务器没有) - How to copy only Mysql database structure from development to production server (production server have data, and development server no ) 如何将数据从生产数据库迁移到开发数据库(第4条)? - How do I migrate data from production db to development db (Rails 4)? 在生产中但不在开发中的MYSQL中查询缓慢 - Slow query in MYSQL on production but not development 将MySQL从开发转移到生产 - Transfer mySQL from development to production Rails MYSQL迁移仅在TEST上失败? - Rails MYSQL migrations failing only on TEST? Rails,如何将数据从开发sqlite3数据库迁移到生产MySQL数据库? - Rails, how to migrate data from development sqlite3 database to production MySQL database? Ruby on Rails,保存! 返回true,但数据库行未更改(仅在生产中;在开发中工作正常) - Ruby on Rails, save! returns true but database row is unchanged (only in production; works fine in development)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM