add pointless nullables

This commit is contained in:
weeman 2021-06-13 14:47:16 +02:00
parent c33c08fe0a
commit 51a1898176
Signed by untrusted user: weeman
GPG Key ID: 34F0524D4DA694A1

View File

@ -29,7 +29,7 @@ class Token(db.Model):
__tablename__ = "token" __tablename__ = "token"
id = Column(Integer, primary_key=True) 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) token = Column(String(36), nullable=False)
user = relationship("User", back_populates="tokens") user = relationship("User", back_populates="tokens")
@ -39,9 +39,9 @@ class Contact(db.Model):
__tablename__ = "contact" __tablename__ = "contact"
id = Column(Integer, primary_key=True) 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") 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") contacttype = relationship("ContactType")
content = Column(String(200), nullable=False) content = Column(String(200), nullable=False)
@ -65,7 +65,7 @@ class Address(db.Model):
city = Column(String(25), default="") city = Column(String(25), default="")
country = 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") user = relationship("User", back_populates="address")