SQL

CREATE TABLE households_to_ingredient_foods  (
  household_id CHAR(32),
  food_id CHAR(32),
  FOREIGN KEY(food_id) REFERENCES ingredient_foods (id),
  FOREIGN KEY(household_id) REFERENCES households (id),
  CONSTRAINT household_id_food_id_key UNIQUE (household_id, food_id)
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
household_id CHAR(32) Rename | Drop
food_id CHAR(32) Rename | Drop

Foreign Keys

Column Destination
household_id households.id
food_id ingredient_foods.id

+ Add index

Indexes

Name Columns Unique SQL Drop?
ix_households_to_ingredient_foods_food_id food_id SQL
CREATE INDEX ix_households_to_ingredient_foods_food_id
ON households_to_ingredient_foods (food_id)
Drop
ix_households_to_ingredient_foods_household_id household_id SQL
CREATE INDEX ix_households_to_ingredient_foods_household_id
ON households_to_ingredient_foods (household_id)
Drop
sqlite_autoindex_households_to_ingredient_foods_1
  • household_id
  • food_id
SQL
-- no sql found --
Drop