<gh_stars>1-10
"""Add canned responses

Revision ID: b5900a4c68b4
Revises: <KEY>
Create Date: 2021-03-13 06:09:15.752989+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision = "<KEY>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "canned_responses",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("key", sa.String(length=32), nullable=False),
        sa.Column("title", sa.String(length=256), nullable=False),
        sa.Column("content", sa.Text(), nullable=False),
        sa.Column("fields", sa.Text(), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(
        op.f("ix_canned_responses_id"),
        "canned_responses",
        ["id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_canned_responses_key"),
        "canned_responses",
        ["key"],
        unique=True,
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(
        op.f("ix_canned_responses_key"), table_name="canned_responses"
    )
    op.drop_index(
        op.f("ix_canned_responses_id"), table_name="canned_responses"
    )
    op.drop_table("canned_responses")
    # ### end Alembic commands ###
