summaryrefslogtreecommitdiff
path: root/cli/app/sql/models/upload.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-03-16 16:54:28 +0100
committerJules Laplace <julescarbon@gmail.com>2021-03-16 16:54:28 +0100
commit1cfe96ca6ef5c54eadd986c951dade0f56d72440 (patch)
tree02d34b15a24afa43c6edf7b0011d56bc2c2c49c4 /cli/app/sql/models/upload.py
parenta9d86650f40a82a64d1fd8e0525c26422d314d3a (diff)
migrating to mysql
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)