From 51a189817629d4f35d40dc3b7f8dd307200a33f2 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sun, 13 Jun 2021 14:47:16 +0200 Subject: [PATCH] add pointless nullables --- ki/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ki/models.py b/ki/models.py index 1cac430..f9a6c20 100644 --- a/ki/models.py +++ b/ki/models.py @@ -29,7 +29,7 @@ class Token(db.Model): __tablename__ = "token" id = Column(Integer, primary_key=True) - user_id = Column(Integer, ForeignKey("user.id")) + user_id = Column(Integer, ForeignKey("user.id"), nullable=False) token = Column(String(36), nullable=False) user = relationship("User", back_populates="tokens") @@ -39,9 +39,9 @@ class Contact(db.Model): __tablename__ = "contact" id = Column(Integer, primary_key=True) - user_id = Column(Integer, ForeignKey("user.id")) + user_id = Column(Integer, ForeignKey("user.id"), nullable=False) user = relationship("User", back_populates="contacts") - contacttype_id = Column(Integer, ForeignKey("contacttype.id")) + contacttype_id = Column(Integer, ForeignKey("contacttype.id"), nullable=False) contacttype = relationship("ContactType") content = Column(String(200), nullable=False) @@ -65,7 +65,7 @@ class Address(db.Model): city = Column(String(25), default="") country = Column(String(25), default="") - user_id = Column(Integer, ForeignKey("user.id")) + user_id = Column(Integer, ForeignKey("user.id"), nullable=False) user = relationship("User", back_populates="address")