Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1819 Add fields to VAProfile cache table #1825

Merged
merged 4 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ###