"""add record comments

Revision ID: bf31e6366a10
Revises: 1ebfc89accb9
Create Date: 2021-12-17 16:54:02.355727

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "bf31e6366a10"
down_revision = "1ebfc89accb9"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "record_comments",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("record_id", sa.Integer(), nullable=False),
        sa.Column("timestamp", sa.DateTime(), nullable=False),
        sa.Column("username", sa.String(), nullable=True),
        sa.Column("comment", sa.String(), nullable=False),
        sa.ForeignKeyConstraint(["record_id"], ["base_record.id"], ondelete="CASCADE"),
        sa.PrimaryKeyConstraint("id"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("record_comments")
    # ### end Alembic commands ###
