SQL
CREATE TABLE recipe_comments (
created_at DATETIME,
update_at DATETIME,
id CHAR(32) NOT NULL,
text VARCHAR,
recipe_id CHAR(32) NOT NULL,
user_id CHAR(32) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY(recipe_id) REFERENCES recipes (id),
FOREIGN KEY(user_id) REFERENCES users (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 | |
text |
VARCHAR |
✓ | Rename | Drop | |
recipe_id |
CHAR(32) |
Rename | Drop | ||
user_id |
CHAR(32) |
Rename | Drop |
Foreign Keys
| Column | Destination |
|---|---|
user_id |
users.id |
recipe_id |
recipes.id |
Indexes
| Name | Columns | Unique | SQL | Drop? |
|---|---|---|---|---|
| ix_recipe_comments_created_at |
created_at
|
SQL | Drop | |
| ix_recipe_comments_recipe_id |
recipe_id
|
SQL | Drop | |
| ix_recipe_comments_user_id |
user_id
|
SQL | Drop | |
| sqlite_autoindex_recipe_comments_1 |
id
|
✓ | SQL | Drop |