From cf7beb0789a327a8fad8ee0bd51157f7e399c7d1 Mon Sep 17 00:00:00 2001 From: Mike Bennett Date: Mon, 26 Feb 2024 12:11:37 +0000 Subject: [PATCH] Add datafile relationship to model (#12) --- app/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models.py b/app/models.py index 755ba27..cdd2306 100644 --- a/app/models.py +++ b/app/models.py @@ -16,6 +16,8 @@ class User(Model): primary_use = db.Column(db.JSON, nullable=True) additional_info = db.Column(db.Text, nullable=True) has_accessed = db.Column(db.Boolean, nullable=True) + datafile_id = db.Column(db.Integer, db.ForeignKey('datafiles.id')) + datafile = db.relationship('Datafile', lazy=True) def generate_token(self): return create_access_token(identity=self.id, expires_delta=timedelta(days=1))