"""Add service iteration record

Revision ID: ee6defa818d6
Revises: 11a500398106
Create Date: 2023-01-18 15:23:51.842564

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "ee6defa818d6"
down_revision = "11a500398106"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "service_subtask_record",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("required_programs", sa.JSON(), nullable=False),
        sa.Column("function", sa.String(), nullable=False),
        sa.Column("function_kwargs", sa.JSON(), nullable=False),
        sa.Column("results", sa.JSON(), nullable=True),
        sa.ForeignKeyConstraint(["id"], ["base_record.id"], ondelete="cascade"),
        sa.PrimaryKeyConstraint("id"),
    )
    # ### end Alembic commands ###


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