"""Drop the comments table. Comments were a discussion thread under every article and question. Nothing read them into anyone's work, so they collected opinion nobody was obliged to answer. Feedback replaced them: a message addressed to whoever maintains the question, which an educator resolves, replies to, or deletes. The table was empty when this was written, so nothing is lost. The downgrade recreates the shape but cannot recreate rows. Revision ID: e5f6a7b8c9d0 Revises: d4e5f6a7b8c9 """ import sqlalchemy as sa from alembic import op revision = "e5f6a7b8c9d0" down_revision = "d4e5f6a7b8c9" branch_labels = None depends_on = None def upgrade() -> None: op.drop_table("comments") def downgrade() -> None: op.create_table( "comments", sa.Column("id", sa.Integer(), primary_key=True, index=True), sa.Column("article_id", sa.Integer(), sa.ForeignKey("articles.id", ondelete="CASCADE"), nullable=True), sa.Column("question_id", sa.Integer(), sa.ForeignKey("questions.id", ondelete="CASCADE"), nullable=True), sa.Column("user_id", sa.Integer(), sa.ForeignKey("users.id", ondelete="SET NULL"), nullable=True), sa.Column("content", sa.Text(), nullable=False), sa.Column("status", sa.String(), server_default="pending"), sa.Column("created_at", sa.DateTime(), nullable=True), )