diff --git a/crc/models/file.py b/crc/models/file.py index 39db78ab..379c591f 100644 --- a/crc/models/file.py +++ b/crc/models/file.py @@ -9,17 +9,25 @@ from crc import db class FileType(enum.Enum): bpmn = "bpmm" + csv = 'csv' dmn = "dmn" + doc = "doc" docx = "docx" gif = 'gif' jpg = 'jpg' + md = 'md' pdf = 'pdf' png = 'png' + ppt = 'ppt' + pptx = 'pptx' + rtf = 'rtf' svg = "svg" + svg_xml = "svg+xml" + txt = 'txt' + xls = 'xls' xlsx = 'xlsx' + xml = 'xml' zip = 'zip' - image = 'image' - class FileDataModel(db.Model): __tablename__ = 'file_data' diff --git a/migrations/versions/f9c4e92a8afe_.py b/migrations/versions/02fcf09d9085_.py similarity index 89% rename from migrations/versions/f9c4e92a8afe_.py rename to migrations/versions/02fcf09d9085_.py index abded953..5b3780c2 100644 --- a/migrations/versions/f9c4e92a8afe_.py +++ b/migrations/versions/02fcf09d9085_.py @@ -1,8 +1,8 @@ """empty message -Revision ID: f9c4e92a8afe -Revises: -Create Date: 2020-02-04 12:49:57.265041 +Revision ID: 02fcf09d9085 +Revises: +Create Date: 2020-02-05 17:18:35.324675 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = 'f9c4e92a8afe' +revision = '02fcf09d9085' down_revision = None branch_labels = None depends_on = None @@ -51,13 +51,14 @@ def upgrade(): sa.Column('name', sa.String(), nullable=True), sa.Column('version', sa.Integer(), nullable=True), sa.Column('last_updated', sa.DateTime(timezone=True), nullable=True), - sa.Column('type', sa.Enum('bpmn', 'dmn', 'docx', 'gif', 'jpg', 'pdf', 'png', 'svg', 'xlsx', 'zip', 'image', name='filetype'), nullable=True), + sa.Column('type', sa.Enum('bpmn', 'csv', 'dmn', 'doc', 'docx', 'gif', 'jpg', 'md', 'pdf', 'png', 'ppt', 'pptx', 'rtf', 'svg', 'svg_xml', 'txt', 'xls', 'xlsx', 'xml', 'zip', name='filetype'), nullable=True), sa.Column('primary', sa.Boolean(), nullable=True), sa.Column('content_type', sa.String(), nullable=True), sa.Column('workflow_spec_id', sa.String(), nullable=True), sa.Column('workflow_id', sa.Integer(), nullable=True), sa.Column('study_id', sa.Integer(), nullable=True), sa.Column('task_id', sa.String(), nullable=True), + sa.Column('form_field_key', sa.String(), nullable=True), sa.ForeignKeyConstraint(['study_id'], ['study.id'], ), sa.ForeignKeyConstraint(['workflow_id'], ['workflow.id'], ), sa.ForeignKeyConstraint(['workflow_spec_id'], ['workflow_spec.id'], ), diff --git a/migrations/versions/d08b0fffc43e_.py b/migrations/versions/d08b0fffc43e_.py deleted file mode 100644 index a75fd62d..00000000 --- a/migrations/versions/d08b0fffc43e_.py +++ /dev/null @@ -1,28 +0,0 @@ -"""empty message - -Revision ID: d08b0fffc43e -Revises: f9c4e92a8afe -Create Date: 2020-02-05 14:53:25.664026 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'd08b0fffc43e' -down_revision = 'f9c4e92a8afe' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('file', sa.Column('form_field_key', sa.String(), nullable=True)) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('file', 'form_field_key') - # ### end Alembic commands ###