Question

This is my first rails app, one I'm creating for the sole purpose of learning rails.

I created an app where I have Users and Products (and sessions, but this is not relevant here). After doing a rake db:mograte creating a few items and testing, I then wanted to add a relationship, where products belongs_to :users and a users has_many :products.

But of course, since I have already created the tables, there isn't any column there to save this information.

How do I make a migration on the database so it will reflect this model? Is there a console tool for it? Do I have to install a third party gem?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top