atst/alembic/versions/2572be7fb7fc_add_request_internal_comments.py
richard-dds 100048afdf Add Request.internal_comments
Using a one to one relationship to avoid the migration hell
that we're temporarily stuck in.
2018-09-11 16:37:55 -04:00

37 lines
1.1 KiB
Python

"""add request.internal_comments
Revision ID: 2572be7fb7fc
Revises: dea6b8e09d63
Create Date: 2018-09-11 15:28:27.252248
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '2572be7fb7fc'
down_revision = 'dea6b8e09d63'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('request_internal_comments',
sa.Column('id', sa.BigInteger(), nullable=False),
sa.Column('text', sa.String(), nullable=True),
sa.Column('user_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('request_id', postgresql.UUID(as_uuid=True), nullable=True),
sa.ForeignKeyConstraint(['request_id'], ['requests.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('request_internal_comments')
# ### end Alembic commands ###