Updates to template endpoints:

- moved into templates rest class
- updated dao
- removed delete methods
- constraint on subject line
This commit is contained in:
Martyn Inglis
2016-02-22 12:55:18 +00:00
parent 443691402f
commit 9bb95a53ec
7 changed files with 540 additions and 383 deletions

View 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')