3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rails db:createってしなくてもいいの?

Last updated at Posted at 2020-07-17

結論

Sqlite3であれば開発環境用DBだけしか使わないのであれば、実行しなくてOK

でも、MySQLやPostgreSQLを使用しているのであれば、必要です。

(2020.7.17追記)

環境

Ruby on Rails 5.2

railsでアプリを開発する時の個人的お決まり手順

ターミナル上で

  1. rails new "アプリ名"
  2. rails db:create
  3. rails db:migrate

下記でもDB作成→テーブル作成できている

  1. rails new "アプリ名"
  2. rails db:migrate

rails db:create がマストだと思ってたけど、違うっぽい

rails db:create を実行する場合としない場合の違い

rails db:create を実行する場合
▶︎ テスト環境用DBと開発環境用DBが作成される

rails db:create を実行しない場合
▶︎ 開発環境用DBのみ作成される

3
4
2

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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?