herokuにデータベースのデータをインポートする
tapsを使うと、ローカルデータベースのデータをherokuのデータベースに簡単にインポートできます。
環境
- Rails 2.3.5
- Ruby 1.8.7
- gem
- heroku 1.8.3
- taps 0.2.26
事前準備
tapsをインストールします。
gem install taps
インポートのやり方
アプリのカレントディレクトリで"heroku db:push"コマンドを実行するだけです。
$ heroku db:push Auto-detected local database: postgres://ユーザー名:パスワード@ホスト名/assist_development?encoding=utf8 Sending schema Sending data 5 tables, 1,262 records schema_migrat: 100% |==========================================| Time: 00:00:00 games: 100% |==========================================| Time: 00:00:00 models: 100% |==========================================| Time: 00:00:00 machines: 100% |==========================================| Time: 00:00:00 machine_logs: 100% |==========================================| Time: 00:00:04 Sending indexes Resetting sequences
実行結果
レコードがインサートされるわけではなく、ローカルDBと同じ状態になります。
ドロップ、クリエイトされてるのではないでしょうか?