LoginSignup
0
0

More than 3 years have passed since last update.

途中でDBを変更する方法

Last updated at Posted at 2020-11-21

gemにある既存のDBを変更

$ bundle install


config/database.ymlにある既存のDBを変更

$ rake db:create
$ rake db:migrate
== 20201120000030 CreateUsers: migrating ======================================
-- create_table(:users)
   -> 0.1683s
== 20201120000030 CreateUsers: migrated (0.1690s) =============================

== 20201120004112 AddIndexToUsersEmail: migrating =============================
-- add_index(:users, :email, {:unique=>true})
   -> 0.1129s
.
.
.
.

完了。

一言: gemファイルだけ変更すればいいと思っていました。database.ymlも変更する必要があると知りました。

参考:
https://stackoverflow.com/questions/52477636/gemloaderror-error-loading-the-sqlite3-active-record-adapter
https://qiita.com/pchatsu/items/a7f53da2e57ae4aca065

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