mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-05 08:40:29 -04:00
add new service whitelist table
services can have a whitelist of phone numbers and email addresses that they can send to in addition to team members when in trial mode. email_address and mobile_number are nullable and app level checks will be in place to prevent inserting blank rows. they have a created_at date so that we can [potentially] delete them a week later to avoid keeping personally identifying data any longer than necessary
This commit is contained in:
31
migrations/versions/0055_service_whitelist.py
Normal file
31
migrations/versions/0055_service_whitelist.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""add service whitelist table
|
||||
|
||||
Revision ID: 0055_service_whitelist
|
||||
Revises: 0054_perform_drop_status_column
|
||||
Create Date: 2016-09-20 12:12:30.838095
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0055_service_whitelist'
|
||||
down_revision = '0054_perform_drop_status_column'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
op.create_table('service_whitelist',
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('service_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('email_address', sa.String(length=255), nullable=True),
|
||||
sa.Column('mobile_number', sa.String(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_service_whitelist_service_id'), 'service_whitelist', ['service_id'], unique=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('service_whitelist')
|
||||
Reference in New Issue
Block a user