Archive, don’t delete contact lists

So we keep a record of who first uploaded a list it’s better to archive
a list than completely delete it.

The list in the database doesn’t contain any recipient info so this
isn’t a change to what data we’re retaining.

This means updating the endpoints that get contact lists to exclude ones
that are archived.
This commit is contained in:
Chris Hill-Scott
2020-03-26 11:38:04 +00:00
parent 4a6143aeb1
commit 5fe0fafadf
9 changed files with 77 additions and 25 deletions

View File

@@ -0,0 +1,26 @@
"""
Revision ID: 0319_contact_list_archived
Revises: 0318_service_contact_list
Create Date: 2020-03-26 11:16:12.389524
"""
from alembic import op
import sqlalchemy as sa
revision = '0319_contact_list_archived'
down_revision = '0318_service_contact_list'
def upgrade():
op.add_column(
'service_contact_list',
sa.Column('archived', sa.Boolean(), nullable=False, server_default=sa.false()),
)
def downgrade():
op.drop_column(
'service_contact_list',
'archived',
)