Skip to content

Data model needs normalization and relational integrity. #4

@metaperl

Description

@metaperl
ingredients = db.Column("ingredients", db.Text)

If you want a normalized database then Ingredients should be in a different table/tables.

categories = db.Column("categories", db.Text)

The categories most definitely should have an m-to-n relation with the recipes.

rating = db.Column("rating", db.Integer)

Who is rating the recipe and how? Shouldn't the rating be tied to the person rating it? And if so, you need to have a mapping table that contains user_id, recipe_id and rating.

image = db.Column("image", db.Text)

There can be only 1 image per recipe?

class Categories(db.Model):

What is this table doing? And why is there no relational linking between this and the Ingredients table?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions