SQL
CREATE TABLE "group_meal_plans" (
id INTEGER NOT NULL,
created_at DATETIME,
update_at DATETIME,
date DATE NOT NULL,
entry_type VARCHAR NOT NULL,
title VARCHAR NOT NULL,
text VARCHAR NOT NULL,
group_id CHAR(32),
recipe_id CHAR(32),
user_id CHAR(32),
PRIMARY KEY (id),
CONSTRAINT fk_user_mealplans FOREIGN KEY(user_id) REFERENCES users (id),
FOREIGN KEY(recipe_id) REFERENCES recipes (id),
FOREIGN KEY(group_id) REFERENCES groups (id)
)
Columns
| Column | Data type | Allow null | Primary key | Actions |
|---|---|---|---|---|
id |
INTEGER |
✓ | Rename | Drop | |
created_at |
DATETIME |
✓ | Rename | Drop | |
update_at |
DATETIME |
✓ | Rename | Drop | |
date |
DATE |
Rename | Drop | ||
entry_type |
VARCHAR |
Rename | Drop | ||
title |
VARCHAR |
Rename | Drop | ||
text |
VARCHAR |
Rename | Drop | ||
group_id |
CHAR(32) |
✓ | Rename | Drop | |
recipe_id |
CHAR(32) |
✓ | Rename | Drop | |
user_id |
CHAR(32) |
✓ | Rename | Drop |
Foreign Keys
| Column | Destination |
|---|---|
group_id |
groups.id |
recipe_id |
recipes.id |
user_id |
users.id |
Indexes
| Name | Columns | Unique | SQL | Drop? |
|---|---|---|---|---|
| ix_group_meal_plans_created_at |
created_at
|
SQL | Drop | |
| ix_group_meal_plans_date |
date
|
SQL | Drop | |
| ix_group_meal_plans_entry_type |
entry_type
|
SQL | Drop | |
| ix_group_meal_plans_group_id |
group_id
|
SQL | Drop | |
| ix_group_meal_plans_recipe_id |
recipe_id
|
SQL | Drop | |
| ix_group_meal_plans_title |
title
|
SQL | Drop | |
| ix_group_meal_plans_user_id |
user_id
|
SQL | Drop |