Skip to content

Commit

Permalink
add short_name to entity_type so that Asset Types can have short name…
Browse files Browse the repository at this point in the history
…s in the UI. (#823)

Co-authored-by: scott <[email protected]>
Co-authored-by: Evan Blaudy <[email protected]>
  • Loading branch information
3 people authored Jun 26, 2024
1 parent c37966e commit 706292e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions zou/app/models/entity_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class EntityType(db.Model, BaseMixin, SerializerMixin):
"""

name = db.Column(db.String(30), unique=True, nullable=False, index=True)
short_name = db.Column(db.String(20))
description = db.Column(db.Text())
task_types = db.relationship(
"TaskType", secondary=task_type_link, lazy="joined"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Add short_name for Asset Type entity_type
Revision ID: 971dbf5a0faf
Revises: 1bb55759146f
Create Date: 2024-06-20 19:51:15.758780
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


# revision identifiers, used by Alembic.
revision = '971dbf5a0faf'
down_revision = '1bb55759146f'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"entity_type",
sa.Column("short_name", sa.String(length=20), nullable=True),
)

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("entity_type", "short_name")
# ### end Alembic commands ###

0 comments on commit 706292e

Please sign in to comment.