From 3723654332653c6126a05d51c3bd987bdab2372b Mon Sep 17 00:00:00 2001 From: lulunac27a <100660343+lulunac27a@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:21:53 -0500 Subject: [PATCH] Add nullable parameter in database columns --- app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index ccf8a5b..0842895 100644 --- a/app.py +++ b/app.py @@ -20,10 +20,11 @@ class User(db.Model): # user class unique=True, nullable=False) # user id username = db.Column(db.String(80), unique=True, nullable=False) # username - xp = db.Column(db.Float, default=0) # user XP - xp_required = db.Column(db.Float, default=1) # user XP required - total_xp = db.Column(db.Float, default=0) # user total XP - level = db.Column(db.Integer, default=1) # user level + xp = db.Column(db.Float, default=0, nullable=False) # user XP + xp_required = db.Column(db.Float, default=1, + nullable=False) # user XP required + total_xp = db.Column(db.Float, default=0, nullable=False) # user total XP + level = db.Column(db.Integer, default=1, nullable=False) # user level def add_xp(self, amount): # add XP """