summaryrefslogtreecommitdiff
path: root/cli/app/sql/models/upload.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app/sql/models/upload.py')
-rw-r--r--cli/app/sql/models/upload.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/app/sql/models/upload.py b/cli/app/sql/models/upload.py
index 87f758a..30e53dc 100644
--- a/cli/app/sql/models/upload.py
+++ b/cli/app/sql/models/upload.py
@@ -1,4 +1,4 @@
-from sqlalchemy import create_engine, Table, Column, String, Integer, DateTime
+from sqlalchemy import create_engine, Table, Column, ForeignKey, String, Integer, DateTime
import sqlalchemy.sql.functions as func
from sqlalchemy_utc import UtcDateTime, utcnow
from wtforms_alchemy import ModelForm
@@ -14,7 +14,7 @@ class Upload(Base):
"""Table for storing references to various media"""
__tablename__ = 'upload'
id = Column(Integer, primary_key=True)
- graph_id = Column(Integer)
+ graph_id = Column(Integer, ForeignKey('graph.id'), nullable=True)
sha256 = Column(String(256), nullable=False)
fn = Column(String(256), nullable=False)
ext = Column(String(4, convert_unicode=True), nullable=False)