SQL
CREATE TABLE "shopping_list_item_recipe_reference" (
created_at DATETIME,
update_at DATETIME,
id CHAR(32) NOT NULL,
shopping_list_item_id CHAR(32) NOT NULL,
recipe_id CHAR(32),
recipe_quantity FLOAT NOT NULL,
recipe_scale FLOAT NOT NULL,
recipe_note VARCHAR,
PRIMARY KEY (id, shopping_list_item_id),
FOREIGN KEY(recipe_id) REFERENCES recipes (id),
FOREIGN KEY(shopping_list_item_id) REFERENCES shopping_list_items (id)
)
Columns
| Column | Data type | Allow null | Primary key | Actions |
|---|---|---|---|---|
created_at |
DATETIME |
✓ | Rename | Drop | |
update_at |
DATETIME |
✓ | Rename | Drop | |
id |
CHAR(32) |
✓ | Rename | Drop | |
shopping_list_item_id |
CHAR(32) |
✓ | Rename | Drop | |
recipe_id |
CHAR(32) |
✓ | Rename | Drop | |
recipe_quantity |
FLOAT |
Rename | Drop | ||
recipe_scale |
FLOAT |
Rename | Drop | ||
recipe_note |
VARCHAR |
✓ | Rename | Drop |
Foreign Keys
| Column | Destination |
|---|---|
shopping_list_item_id |
shopping_list_items.id |
recipe_id |
recipes.id |
Indexes
| Name | Columns | Unique | SQL | Drop? |
|---|---|---|---|---|
| ix_shopping_list_item_recipe_reference_created_at |
created_at
|
SQL | Drop | |
| ix_shopping_list_item_recipe_reference_recipe_id |
recipe_id
|
SQL | Drop | |
| sqlite_autoindex_shopping_list_item_recipe_reference_1 |
|
✓ | SQL | Drop |