def downgrade()

in annotation/alembic/versions/3136551008d8_agreement_metrics_relation.py [0:0]


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "agreement_score",
        sa.Column(
            "annotator_id",
            postgresql.UUID(),
            autoincrement=False,
            nullable=False,
        ),
        sa.Column("job_id", sa.INTEGER(), autoincrement=False, nullable=False),
        sa.Column(
            "task_id", sa.INTEGER(), autoincrement=False, nullable=False
        ),
        sa.Column(
            "agreement_score",
            postgresql.JSONB(astext_type=sa.Text()),
            autoincrement=False,
            nullable=False,
        ),
        sa.ForeignKeyConstraint(
            ["annotator_id"],
            ["users.user_id"],
            name="agreement_score_annotator_id_fkey",
        ),
        sa.ForeignKeyConstraint(
            ["job_id"],
            ["jobs.job_id"],
            name="agreement_score_job_id_fkey",
            ondelete="CASCADE",
        ),
        sa.ForeignKeyConstraint(
            ["task_id"],
            ["tasks.id"],
            name="agreement_score_task_id_fkey",
            ondelete="CASCADE",
        ),
        sa.PrimaryKeyConstraint("task_id", name="agreement_score_pkey"),
    )