ibeal / KitchenDB

A personal project to create something that can track inventory and recipes to suggest recipes to make determined by inventory
2 stars 0 forks source link

recipe unique composite key #30

Closed ibeal closed 3 years ago

ibeal commented 3 years ago

before finishing the menu and dailyMenu, I need to adjust the key of the recipe table. Currently the key for the table is the title, I would like to switch that to be the combination of title and source.

This also brings a problem with the updating of the recipe. If the source or title is changed, the database assumes a new recipe. I want to add a new/edit mode (invisible to the user) that determines if the old recipe should be deleted, or if a new recipe is being altered. The edit mode would be entered when a recipe is clicked, or the recipe is saved. edit mode would exit if the clear button, delete button, or new recipe buttons are pressed. Hmmm, basically whenever the title field is cleared.... if the editor is in edit mode, whenever the recipe is saved, the previous recipe should be deleted, if the editor is in new mode, recipe checks will take place