Rails - Populate test database with development data

后端 未结 6 1139
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 19:25

Is there any trivial way to copy the data from developmenet database into the test one? I know theres a way to copy schema and recreate database, but is there any rake task to p

6条回答
  •  囚心锁ツ
    2021-01-31 20:07

    If you just want to clone the development DB in its entirety, what's wrong with just copying the development.sqlite3 and renaming it test.sqlite3? You can automate the process by setting up a batch file (or its equivalent on your OS) that you can run from the command line.

    This will work locally, but I just realized you might be thinking a non-local environment, in which case it probably won't.

提交回复
热议问题