mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
This is the first deploy in series of deploys to give certain templates priority in processing.
If the template is marked as priority the notification will be sent using the `notify` queue. The `notify` queue is a low volume queue, messages here will not be queue behind a large job and should be delivered with in a more consistent time frame. - Added templates.process_type and templates_history.process_type column. - Added a template_process_type table to handle the enum for templates.process_type, initial values are normal and priority https://www.pivotaltracker.com/story/show/135429147
This commit is contained in:
38
migrations/versions/0063_templates_process_type.py
Normal file
38
migrations/versions/0063_templates_process_type.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0063_templates_process_type
|
||||
Revises: 0062_provider_details_history
|
||||
Create Date: 2017-01-10 15:39:30.909308
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0063_templates_process_type'
|
||||
down_revision = '0062_provider_details_history'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table('template_process_type',
|
||||
sa.Column('name', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('name')
|
||||
)
|
||||
op.execute("INSERT INTO template_process_type VALUES ('normal'), ('priority')")
|
||||
op.add_column('templates', sa.Column('process_type', sa.String(length=255), nullable=True))
|
||||
op.create_index(op.f('ix_templates_process_type'), 'templates', ['process_type'], unique=False)
|
||||
op.create_foreign_key('templates_history_process_type_fkey', 'templates', 'template_process_type', ['process_type'], ['name'])
|
||||
op.add_column('templates_history', sa.Column('process_type', sa.String(length=255), nullable=True))
|
||||
op.create_index(op.f('ix_templates_history_process_type'), 'templates_history', ['process_type'], unique=False)
|
||||
op.create_foreign_key('templates_process_type_fkey', 'templates_history', 'template_process_type', ['process_type'], ['name'])
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_constraint('templates_history_process_type_fkey', 'templates_history', type_='foreignkey')
|
||||
op.drop_index(op.f('ix_templates_history_process_type'), table_name='templates_history')
|
||||
op.drop_column('templates_history', 'process_type')
|
||||
op.drop_constraint('templates_process_type_fkey', 'templates', type_='foreignkey')
|
||||
op.drop_index(op.f('ix_templates_process_type'), table_name='templates')
|
||||
op.drop_column('templates', 'process_type')
|
||||
op.drop_table('template_process_type')
|
||||
Reference in New Issue
Block a user