We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa62b7f commit c8fe7edCopy full SHA for c8fe7ed
database.sql
@@ -180,3 +180,16 @@ CREATE OR REPLACE TABLE recipe_rating (
180
FOREIGN KEY (recipe_id) REFERENCES recipe (recipe_id) ON DELETE CASCADE,
181
UNIQUE (person_id, recipe_id)
182
) ENGINE = InnoDB;
183
+
184
+CREATE OR REPLACE TABLE category (
185
+ category_id INT AUTO_INCREMENT PRIMARY KEY,
186
+ category_name VARCHAR(50) UNIQUE
187
+) ENGINE = InnoDB;
188
189
+CREATE OR REPLACE TABLE recipe_category (
190
+ recipe_id INT,
191
+ category_id INT,
192
+ PRIMARY KEY (recipe_id, category_id),
193
+ FOREIGN KEY (recipe_id) REFERENCES recipe (recipe_id) ON DELETE CASCADE,
194
+ FOREIGN KEY (category_id) REFERENCES category (category_id) ON DELETE CASCADE
195
0 commit comments