mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 16:23:44 -04:00
This deletes a big ol' chunk of code related to letters. It's not everything—there are still a few things that might be tied to sms/email—but it's the the heart of letters function. SMS and email function should be untouched by this. Areas affected: - Things obviously about letters - PDF tasks, used for precompiling letters - Virus scanning, used for those PDFs - FTP, used to send letters to the printer - Postage stuff
46 lines
2.6 KiB
Python
46 lines
2.6 KiB
Python
"""
|
|
|
|
Revision ID: 0388_no_serv_letter_contact.py
|
|
Revises: 0387_remove_letter_perms_.py
|
|
Create Date: 2023-02-17 14:42:52.679425
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
revision = '0388_no_serv_letter_contact.py'
|
|
down_revision = '0387_remove_letter_perms_.py'
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index('ix_service_letter_contacts_service_id', table_name='service_letter_contacts')
|
|
op.drop_constraint('templates_service_letter_contact_id_fkey', 'templates', type_='foreignkey')
|
|
op.drop_column('templates', 'service_letter_contact_id')
|
|
op.drop_constraint('templates_history_service_letter_contact_id_fkey', 'templates_history', type_='foreignkey')
|
|
op.drop_column('templates_history', 'service_letter_contact_id')
|
|
op.drop_table('service_letter_contacts')
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('templates_history', sa.Column('service_letter_contact_id', postgresql.UUID(), autoincrement=False, nullable=True))
|
|
op.create_foreign_key('templates_history_service_letter_contact_id_fkey', 'templates_history', 'service_letter_contacts', ['service_letter_contact_id'], ['id'])
|
|
op.add_column('templates', sa.Column('service_letter_contact_id', postgresql.UUID(), autoincrement=False, nullable=True))
|
|
op.create_foreign_key('templates_service_letter_contact_id_fkey', 'templates', 'service_letter_contacts', ['service_letter_contact_id'], ['id'])
|
|
op.create_table('service_letter_contacts',
|
|
sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False),
|
|
sa.Column('service_id', postgresql.UUID(), autoincrement=False, nullable=False),
|
|
sa.Column('contact_block', sa.TEXT(), autoincrement=False, nullable=False),
|
|
sa.Column('is_default', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
|
sa.Column('created_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
|
|
sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
|
|
sa.Column('archived', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False),
|
|
sa.ForeignKeyConstraint(['service_id'], ['services.id'], name='service_letter_contacts_service_id_fkey'),
|
|
sa.PrimaryKeyConstraint('id', name='service_letter_contacts_pkey')
|
|
)
|
|
op.create_index('ix_service_letter_contacts_service_id', 'service_letter_contacts', ['service_id'], unique=False)
|
|
# ### end Alembic commands ###
|