How can I migrate my database with rails to the first revision without dropping the database first?

前端 未结 3 1917
深忆病人
深忆病人 2020-12-14 21:04

I have a database set up for my Rails installation and some migrations set up. I would like to be able to reset my database back down to having no tables/constraints/etc., b

3条回答
  •  醉话见心
    2020-12-14 21:21

    In addition to jdl's (correct) solution above, another hack-y way to acheive this is to do rake db:rollback STEP=1000000, where 1000000 is a large number, larger than the number of migrations you'll ever have. It will rollback as far as it can up to 1000000 times, or however many times you put as the STEP.

提交回复
热议问题