meal_homework/mealapi/model/ingredient.py
Torma Kristóf da7dd7eec6
All checks were successful
continuous-integration/drone/push Build is passing
use foreign key
2022-02-13 21:06:52 +01:00

10 lines
277 B
Python

#!/usr/bin/env python3
from .db import db
class Ingredient(db.Model):
__tablename__ = 'Ingredient'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False, unique=True)
meal_id = db.Column(db.Integer, db.ForeignKey('Meal.id'))