SQL
CREATE TABLE households_to_recipes (
id CHAR(32) NOT NULL,
household_id CHAR(32) NOT NULL,
recipe_id CHAR(32) NOT NULL,
last_made DATETIME,
created_at DATETIME,
update_at DATETIME,
PRIMARY KEY (id, household_id, recipe_id),
FOREIGN KEY(household_id) REFERENCES households (id),
FOREIGN KEY(recipe_id) REFERENCES recipes (id),
CONSTRAINT household_id_recipe_id_key UNIQUE (household_id, recipe_id)
)
Columns
| Column | Data type | Allow null | Primary key | Actions |
|---|---|---|---|---|
id |
CHAR(32) |
✓ | Rename | Drop | |
household_id |
CHAR(32) |
✓ | Rename | Drop | |
recipe_id |
CHAR(32) |
✓ | Rename | Drop | |
last_made |
DATETIME |
✓ | Rename | Drop | |
created_at |
DATETIME |
✓ | Rename | Drop | |
update_at |
DATETIME |
✓ | Rename | Drop |
Foreign Keys
| Column | Destination |
|---|---|
recipe_id |
recipes.id |
household_id |
households.id |
Indexes
| Name | Columns | Unique | SQL | Drop? |
|---|---|---|---|---|
| ix_households_to_recipes_created_at |
created_at
|
SQL | Drop | |
| ix_households_to_recipes_household_id |
household_id
|
SQL | Drop | |
| ix_households_to_recipes_recipe_id |
recipe_id
|
SQL | Drop | |
| sqlite_autoindex_households_to_recipes_1 |
|
✓ | SQL | Drop |
| sqlite_autoindex_households_to_recipes_2 |
|
✓ | SQL | Drop |