Rails remove old models with migrations

后端 未结 7 1937
傲寒
傲寒 2021-02-13 01:41

I have a bunch of rails models that i\'m re-writing into a single model to simplify my code and reduce unnecessary tables.

I\'m wondering what the best way to delete a

7条回答
  •  我在风中等你
    2021-02-13 02:16

    Depending on how far into development or production you are, you may want to migrate the models out safely using a migration to remove/backup data or what not. Then as bobbywilson0 suggested, using

    script/destroy model
    

    or if you rspec anything

    script/destroy rspec_model
    

    This will remove any spec tests as well.

    Or you can always just drag them to the trash folder.

提交回复
热议问题