migration - For Ruby on Rails, how do you switch to a new and empty DB with the same DBMS or a different DBMS? -



migration - For Ruby on Rails, how do you switch to a new and empty DB with the same DBMS or a different DBMS? -

if no need migrate data, seems can edit database.yml

development: adapter: mysql database: myapp_development host: localhost username: root password: encoding: utf8

1) utilize brand new db 0 data, alter 3rd line to:

database: myapp_development_02

and rake db:create , rake db:migrate , now, have brand new db 0 data?

2) if specifying using sqlite, can alter mysql description top part of post, , rake db:create , rake db:migrate, , have brand new db work with, , mysql?

3) rails 3 has db/schema.rb. can used instead of rake db:migrate, involve 30 migrations if there 30 migration files, if using schema.rb, can reach database schemas in 1 step?

4) think can create other development_02, etc, in database.yml file, pointing old db, or pointing different dbms, create sure run

rails ... -e development_02 ... or rake ... rails_env=development_02

?

yes yes yes. in fact, preferred way if have big schema. yes. you'll need add together config/environments/development_02.rb

ruby-on-rails migration ruby-on-rails-3 database-migration

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -