Added ID as pk

This commit is contained in:
Kelly McDonald 2020-11-11 11:36:25 -05:00
parent 9a4d167dcd
commit acaf633b45
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,8 @@ from crc import db
class DataStoreModel(db.Model):
__tablename__ = 'data_store'
key = db.Column(db.String, primary_key=True)
id = db.Column(db.Integer, primary_key=True)
key = db.Column(db.String)
workflow_id = db.Column(db.Integer)
study_id = db.Column(db.Integer)
task_id = db.Column(db.String)

View File

@ -19,9 +19,10 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('data_store',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('key', sa.String(), nullable=False),
sa.Column('value', sa.String(), nullable=True),
sa.PrimaryKeyConstraint('key')
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###