I had a model customer, which I have generated using the following
rails g model Customer name:string
After some time, I decided to rename the model to customer_type, to accomplish this we wrote an another migration
rails g migration RenameCutomerToCustomerType
everything was smooth until I had the requirement to add the model named customer. When I issued the following command, I've started getting "Another mi开发者_JAVA技巧gration is already named create_customer"
rails g model Customer
I think this kind of scenario is very common in CRUD based project, please suggest on how to over come this? Is this a limitation with rails?
Just rename old migration filename and classname. Both don't affect anything.
btw: This scenario is quite rare so I don't think that there is any need in specific actions from framework
rails destroy model MODELNAME, will remove the model.
精彩评论