LoginSignup
0
0

More than 3 years have passed since last update.

Rails データベースの名前はどこで決まっている?

Posted at

某スクールで用意されているファイルをクローンした際に
フォルダ名を変更していたにも関わらず、rake db:createを実行したら
元:example
名前変更:example1
と下記の様に既にDBが存在すると言われてしまった。
example_development already exists
example_test already exists

しかもexampleのままで作ろとしている!フォルダ名変えたのに!
じゃデータベース名はどこで定義されているのか?

データベースの定義場所

データベースはconfig>database.ymlで定義されています

この中には
開発環境 :development
テスト環境 :test
本番環境 :production
でのデータベースに関する情報が書かれています。
その中で:database: 名前とあるのでここを読み取り作成している。
なのでここを変更してあげれば解決します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0