Skip to content

Commit

Permalink
#1819 Add fields to VAProfile cache table (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchlwellman authored May 29, 2024
1 parent 7e37a1f commit a9b3258
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2181,6 +2181,9 @@ class VAProfileLocalCache(db.Model):
communication_channel_id = db.Column(db.Integer, nullable=False)
source_datetime = db.Column(db.DateTime, nullable=False)

participant_id = db.Column(db.Integer, nullable=True)
has_duplicate_mappings = db.Column(db.Boolean, nullable=False, default=False)

__table_args__ = (
UniqueConstraint('va_profile_id', 'communication_item_id', 'communication_channel_id', name='uix_veteran_id'),
)
Expand Down
26 changes: 26 additions & 0 deletions migrations/versions/0369_vaprofile_cache_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
Revision ID:0369_vaprofile_cache_fields
Revises: 0368_servicesmssender_columns
Create Date: 2024-05-29 10:55:37
"""
from alembic import op
import sqlalchemy as sa

revision = '0369_va_profile_cache_fields'
down_revision = '0368_servicesmssender_columns'


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('va_profile_local_cache', sa.Column('participant_id', sa.Integer(), nullable=True))
op.add_column('va_profile_local_cache', sa.Column('has_duplicate_mappings', sa.Boolean(), nullable=False, server_default=sa.false()))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('va_profile_local_cache', 'has_duplicate_mappings')
op.drop_column('va_profile_local_cache', 'participant_id')
# ### end Alembic commands ###

0 comments on commit a9b3258

Please sign in to comment.