I created a rails model by doing
script/generate model Customer name:string address:string city:string state:string zip:integer [...]
I filled the database with 5000 customers and started building my app. Now I've realized my model isn't normalized: I often have multiple customers at the same address! If I wish to do something per-address, like, say, a mailing, this causes problems. What I'd like to have is a Address
model, a Customer
model, and a Mailing
model.
Is there a rails way to normalize an existing model, splitting it into two models? Or should I just write a script to normalize my existing data, then generate new models accordingly?