Create join table migration in Rails
3 April 2022 (Updated 3 April 2022)
Suppose you want to create a quotes_tags
join table with two foreign keys:
quote_id
: foreign key ofquotes.id
tag_id
: foreign key oftags.id
You can do this with:
Update the generated migration file to the following:
Tagged:
Rails
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment