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

Migration script for new document templates- redaction summary #5047

Merged
merged 1 commit into from
Feb 9, 2024
Merged
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
32 changes: 32 additions & 0 deletions request-management-api/migrations/versions/932d6dae5570_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""empty message

Revision ID: 932d6dae5570
Revises: b4da31675bd0
Create Date: 2024-02-05 14:00:56.263099

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '932d6dae5570'
down_revision = 'b4da31675bd0'
branch_labels = None
depends_on = None


def upgrade():
op.execute('insert into public."DocumentTypes"(document_type_name, description) VALUES (\'redline_redaction_summary\', \'Word template for redline redaction summary pdf\');commit;')
op.execute('insert into public."DocumentTypes"(document_type_name, description) VALUES (\'responsepackage_redaction_summary\', \'Word template for response package redaction summary pdf\');commit;')

op.execute('insert into public."DocumentTemplates"(extension, document_type_id) VALUES (\'docx\', (select document_type_id from public."DocumentTypes" where document_type_name=\'redline_redaction_summary\'));commit;')
op.execute('insert into public."DocumentTemplates"(extension, document_type_id) VALUES (\'docx\', (select document_type_id from public."DocumentTypes" where document_type_name=\'responsepackage_redaction_summary\'));commit;')

def downgrade():
op.execute('delete from public."DocumentTypes" where document_type_name = \'redline_redaction_summary\'')
op.execute('delete from public."DocumentTypes" where document_type_name = \'responsepackage_redaction_summary\'')

op.execute('delete from public."DocumentTemplates" where document_type_id = (select document_type_id from public."DocumentTypes" where document_type_name=\'redline_redaction_summary\')')
op.execute('delete from public."DocumentTemplates" where document_type_id = (select document_type_id from public."DocumentTypes" where document_type_name=\'responsepackage_redaction_summary\')')

Loading