mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
Updates to template endpoints:
- moved into templates rest class - updated dao - removed delete methods - constraint on subject line
This commit is contained in:
26
migrations/versions/0020_email_has_subject.py
Normal file
26
migrations/versions/0020_email_has_subject.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0020_email_has_subject
|
||||
Revises: 0019_unique_servicename
|
||||
Create Date: 2016-02-18 11:45:29.102891
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0020_email_has_subject'
|
||||
down_revision = '0019_unique_servicename'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_check_constraint(
|
||||
"ch_email_template_has_subject",
|
||||
"templates",
|
||||
"((template_type='email' and subject is not null) or (template_type!='email' and subject is null))"
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_constraint('ch_email_template_has_subject', 'templates', type_='check')
|
||||
Reference in New Issue
Block a user