Create and run the necessary migration files:
e.g. rails generate migration CreateUsers name:string
Add foreign keys and indices:
e.g. generate migration AddUserRefToFoods user:references
Migration for User table should have the following columns:
name :string
Migration for Food table should have the following columns:
-name :string
measurement_unit :number
price :number
quantity :number
user_id :number [FK]
Migration for Recipe table should have the following columns:
name :string
preparation_time :number
cooking_time :number
description :string
public :boolean
user_id :number [FK]
Migration for Recipe Food table should have the following columns:
Create and run the necessary migration files: e.g. rails generate migration CreateUsers name:string Add foreign keys and indices: e.g. generate migration AddUserRefToFoods user:references
Migration for User table should have the following columns:
-name :string
measurement_unit :number
price :number
quantity :number
user_id :number [FK] Migration for Recipe table should have the following columns:
name :string
preparation_time :number
cooking_time :number
description :string
public :boolean
user_id :number [FK] Migration for Recipe Food table should have the following columns:
quantity :number
recipe_id :number [FK]
food_id :number [FK]