From 3bfe50b15cc0ecb39c8ff95e83c31e5d9645f74d Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Mon, 4 Nov 2019 14:12:15 +0100 Subject: [PATCH] Add status for Corpus model --- app/models.py | 1 + migrations/versions/1210adfe1e34_.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 migrations/versions/1210adfe1e34_.py diff --git a/app/models.py b/app/models.py index 6322b2e0..77892c02 100644 --- a/app/models.py +++ b/app/models.py @@ -436,6 +436,7 @@ class Corpus(db.Model): description = db.Column(db.String(255)) title = db.Column(db.String(32)) user_id = db.Column(db.Integer, db.ForeignKey('users.id')) + status = db.Column(db.String(16)) # Relationships files = db.relationship('CorpusFile', backref='corpus', diff --git a/migrations/versions/1210adfe1e34_.py b/migrations/versions/1210adfe1e34_.py new file mode 100644 index 00000000..edf3a2c9 --- /dev/null +++ b/migrations/versions/1210adfe1e34_.py @@ -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 ###