efficient bulk update rails database

后端 未结 5 929
借酒劲吻你
借酒劲吻你 2020-12-25 10:15

I\'m trying to build a rake utility that will update my database every so often.

This is the code I have so far:

namespace :utils do

  # utils:updat         


        
5条回答
  •  清酒与你
    2020-12-25 10:44

    You could generate a text file with all INSERTs you need and then execute:

    mysql -u user -p db_name < mytextfile.txt
    

    Not sure if this will be any faster but worth a try...

提交回复
热议问题