remove `name` column from workflow_spec and workflow_spec_category

This commit is contained in:
mike cullerton 2021-10-05 13:10:36 -04:00
parent 448b7b2773
commit fcf538ca92
2 changed files with 28 additions and 3 deletions

View File

@ -13,11 +13,11 @@ from crc.models.file import FileModel, FileDataModel
class WorkflowSpecCategoryModel(db.Model):
__tablename__ = 'workflow_spec_category'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String)
display_name = db.Column(db.String)
display_order = db.Column(db.Integer)
admin = db.Column(db.Boolean)
class WorkflowSpecCategoryModelSchema(SQLAlchemyAutoSchema):
class Meta:
model = WorkflowSpecCategoryModel
@ -25,11 +25,9 @@ class WorkflowSpecCategoryModelSchema(SQLAlchemyAutoSchema):
include_relationships = True
class WorkflowSpecModel(db.Model):
__tablename__ = 'workflow_spec'
id = db.Column(db.String, primary_key=True)
name = db.Column(db.String)
display_name = db.Column(db.String)
display_order = db.Column(db.Integer, nullable=True)
description = db.Column(db.Text)

View File

@ -0,0 +1,27 @@
"""remove name from spec and category
Revision ID: 8580676e5302
Revises: 5c63a89ee7b7
Create Date: 2021-10-04 11:58:41.290139
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8580676e5302'
down_revision = '5c63a89ee7b7'
branch_labels = None
depends_on = None
def upgrade():
op.drop_column('workflow_spec_category', 'name')
op.drop_column('workflow_spec', 'name')
def downgrade():
op.add_column('workflow_spec_category', sa.Column('name', sa.String()))
op.add_column('workflow_spec', sa.Column('name', sa.String()))