Add status for Corpus model

This commit is contained in:
Stephan Porada 2019-11-04 14:12:15 +01:00
parent ce39b24937
commit 3bfe50b15c
2 changed files with 29 additions and 0 deletions

View File

@ -436,6 +436,7 @@ class Corpus(db.Model):
description = db.Column(db.String(255)) description = db.Column(db.String(255))
title = db.Column(db.String(32)) title = db.Column(db.String(32))
user_id = db.Column(db.Integer, db.ForeignKey('users.id')) user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
status = db.Column(db.String(16))
# Relationships # Relationships
files = db.relationship('CorpusFile', files = db.relationship('CorpusFile',
backref='corpus', backref='corpus',

View File

@ -0,0 +1,28 @@
"""empty message
Revision ID: 1210adfe1e34
Revises: abf60427ff84
Create Date: 2019-11-04 12:54:39.389263
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1210adfe1e34'
down_revision = 'abf60427ff84'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('corpora', sa.Column('status', sa.String(length=16), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('corpora', 'status')
# ### end Alembic commands ###