Skip to content

Commit

Permalink
Adding owner and pinned attributes to timeline events
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 committed Sep 29, 2023
1 parent bc6e2a6 commit 4456a95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("event", sa.Column("type", sa.String(), nullable=True))
op.add_column('event', sa.Column('owner', sa.String(), nullable=True))
op.add_column('event', sa.Column('pinned', sa.Boolean(), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("event", "type")
op.drop_column('event', 'pinned')
op.drop_column('event', 'owner')
# ### end Alembic commands ###
6 changes: 5 additions & 1 deletion src/dispatch/event/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import Optional

from sqlalchemy import Column, DateTime, ForeignKey, Integer, String
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Boolean
from sqlalchemy.dialects.postgresql import UUID as SQLAlchemyUUID
from sqlalchemy_utils import TSVectorType, JSONType

Expand All @@ -23,6 +23,8 @@ class Event(Base, TimeStampMixin):
description = Column(String, nullable=False)
details = Column(JSONType, nullable=True)
type = Column(String, default=EventType.other, nullable=True)
owner = Column(String, nullable=True)
pinned = Column(Boolean, default=False)

# relationships
individual_id = Column(Integer, ForeignKey("individual_contact.id", ondelete="CASCADE"))
Expand All @@ -48,6 +50,8 @@ class EventBase(DispatchBase):
description: str
details: Optional[dict]
type: Optional[str]
owner: Optional[str]
pinned: Optional[bool]


class EventCreate(EventBase):
Expand Down

0 comments on commit 4456a95

Please sign in to comment.