SQL
CREATE TABLE shopping_list_recipe_reference (
created_at DATETIME,
update_at DATETIME,
id CHAR(32) NOT NULL,
shopping_list_id CHAR(32) NOT NULL,
recipe_id CHAR(32),
recipe_quantity FLOAT NOT NULL,
PRIMARY KEY (id, shopping_list_id),
FOREIGN KEY(recipe_id) REFERENCES recipes (id),
FOREIGN KEY(shopping_list_id) REFERENCES shopping_lists (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_id |
CHAR(32) |
✓ | Rename | Drop | |
recipe_id |
CHAR(32) |
✓ | Rename | Drop | |
recipe_quantity |
FLOAT |
Rename | Drop |
Foreign Keys
| Column | Destination |
|---|---|
shopping_list_id |
shopping_lists.id |
recipe_id |
recipes.id |
Indexes
| Name | Columns | Unique | SQL | Drop? |
|---|---|---|---|---|
| ix_shopping_list_recipe_reference_created_at |
created_at
|
SQL | Drop | |
| ix_shopping_list_recipe_reference_recipe_id |
recipe_id
|
SQL | Drop | |
| sqlite_autoindex_shopping_list_recipe_reference_1 |
|
✓ | SQL | Drop |