简体   繁体   中英

Adding a second SQLite db in Ruby on Rails

I have a ROR application with a sqlite3 db. I want to create a new database, and I do not want to delete the previous one.

  1. how I will define a new db in a current project, so as when I run rake db:create referring to the new one?

generally what is the process to add a new sqlite db in the existing project?

Just change database name in database.yml file

development:
  database: 'changed ndb_name'
  ...

Follow the below steps:

  1. change database name in database.yml file
  2. rake db:create
  3. rake db:migrate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM