cr-connect-workflow/crc/models/data_store.py

27 lines
858 B
Python
Raw Normal View History

from flask_marshmallow.sqla import SQLAlchemyAutoSchema
from sqlalchemy import func
from crc import db
class DataStoreModel(db.Model):
__tablename__ = 'data_store'
2020-11-11 16:36:25 +00:00
id = db.Column(db.Integer, primary_key=True)
last_updated = db.Column(db.DateTime(timezone=True), server_default=func.now())
2020-11-17 14:33:29 +00:00
key = db.Column(db.String, nullable=False)
workflow_id = db.Column(db.Integer)
2020-11-17 14:33:29 +00:00
study_id = db.Column(db.Integer, nullable=True)
task_spec = db.Column(db.String)
spec_id = db.Column(db.String)
2020-11-17 14:33:29 +00:00
user_id = db.Column(db.String, nullable=True)
file_id = db.Column(db.Integer, db.ForeignKey('file.id'), nullable=True)
value = db.Column(db.String)
2020-11-13 14:58:21 +00:00
class DataStoreSchema(SQLAlchemyAutoSchema):
class Meta:
model = DataStoreModel
load_instance = True
include_fk = True
sqla_session = db.session