Generate migration – create join table

To autopopulate the create_join_table command in the command line, it should look like this:

rails g migration CreateJoinTableProductsSuppliers products suppliers

For a Product model and a Supplier model. Rails will create a table titled “products_suppliers”. Note the pluralization.

(Side note that generation command can be shortened to just g)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)