remove nullable=False for being unnecessary

master
Aevann 2024-02-03 01:24:22 +02:00
parent 2532229ec0
commit f166ab35f9
4 changed files with 9 additions and 9 deletions

View File

@ -16,10 +16,10 @@ class AwardRelationship(Base):
user_id = Column(Integer, ForeignKey("users.id"))
post_id = Column(Integer, ForeignKey("posts.id"))
comment_id = Column(Integer, ForeignKey("comments.id"))
kind = Column(String, nullable=False)
kind = Column(String)
awarded_utc = Column(Integer)
created_utc = Column(Integer)
price_paid = Column(Integer, default = 0, nullable=False)
price_paid = Column(Integer, default = 0)
note = Column(String)
user = relationship("User", primaryjoin="AwardRelationship.user_id==User.id", back_populates="awards")

View File

@ -18,8 +18,8 @@ class Hole(Base):
name = Column(VARCHAR(HOLE_NAME_COLUMN_LENGTH), primary_key=True)
sidebar = Column(VARCHAR(HOLE_SIDEBAR_COLUMN_LENGTH))
sidebar_html = Column(VARCHAR(HOLE_SIDEBAR_HTML_COLUMN_LENGTH))
sidebarurls = Column(MutableList.as_mutable(ARRAY(VARCHAR(HOLE_BANNER_URL_COLUMN_LENGTH))), default=MutableList([]), nullable=False)
bannerurls = Column(MutableList.as_mutable(ARRAY(VARCHAR(HOLE_BANNER_URL_COLUMN_LENGTH))), default=MutableList([]), nullable=False)
sidebarurls = Column(MutableList.as_mutable(ARRAY(VARCHAR(HOLE_BANNER_URL_COLUMN_LENGTH))), default=MutableList([]))
bannerurls = Column(MutableList.as_mutable(ARRAY(VARCHAR(HOLE_BANNER_URL_COLUMN_LENGTH))), default=MutableList([]))
marseyurl = Column(VARCHAR(HOLE_MARSEY_URL_LENGTH))
css = deferred(Column(VARCHAR(CSS_LENGTH_LIMIT)))
stealth = Column(Boolean)

View File

@ -84,7 +84,7 @@ class User(Base):
received_award_count = Column(Integer, default=0)
created_utc = Column(Integer)
admin_level = Column(Integer, default=DEFAULT_ADMIN_LEVEL)
last_active = Column(Integer, default=0, nullable=False)
last_active = Column(Integer, default=0)
coins_spent = Column(Integer, default=0)
coins_spent_on_hats = Column(Integer, default=0)
lootboxes_bought = Column(Integer, default=0)
@ -120,7 +120,7 @@ class User(Base):
is_banned = Column(Integer, ForeignKey("users.id"))
unban_utc = Column(Integer)
ban_reason = deferred(Column(String))
is_muted = Column(Boolean, default=False, nullable=False)
is_muted = Column(Boolean, default=False)
login_nonce = Column(Integer, default=0)
coins = Column(Integer, default=DEFAULT_COINS)
truescore = Column(Integer, default=0)
@ -157,7 +157,7 @@ class User(Base):
grinch = Column(Boolean, default=SITE_NAME != 'rDrama') #don't put in an if condition, it will cause an error bc it has a not-null constraint
if IS_HOMOWEEN():
zombie = Column(Integer, default=0, nullable=False) # > 0 vaxxed; < 0 zombie
zombie = Column(Integer, default=0) # > 0 vaxxed; < 0 zombie
jumpscare = Column(Integer, default=0)
badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user")

View File

@ -14,7 +14,7 @@ class Vote(Base):
user_id = Column(Integer, ForeignKey("users.id"), primary_key=True)
vote_type = Column(Integer)
real = Column(Boolean, default=True)
coins = Column(Integer, default=1, nullable=False)
coins = Column(Integer, default=1)
created_utc = Column(Integer)
user = relationship("User")
@ -44,7 +44,7 @@ class CommentVote(Base):
user_id = Column(Integer, ForeignKey("users.id"), primary_key=True)
vote_type = Column(Integer)
real = Column(Boolean, default=True)
coins = Column(Integer, default=1, nullable=False)
coins = Column(Integer, default=1)
created_utc = Column(Integer)
user = relationship("User")