<filename>backend/migrations/versions/3e2d8b975154_self_referential_uploads.py
"""self-referential uploads

Revision ID: 3e2d8b975154
Revises: 0<PASSWORD>
Create Date: 2021-01-13 13:51:16.349425

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3e2d8b975154'
down_revision = '00d6a016a0c0'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('image_upload_url', schema=None) as batch_op:
        batch_op.add_column(sa.Column('parent_id', sa.String(), nullable=True))
        batch_op.add_column(sa.Column('partNumber', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('totalParts', sa.Integer(), nullable=True))
        batch_op.create_foreign_key(batch_op.f('fk_image_upload_url_parent_id_image_upload_url'), 'image_upload_url', ['parent_id'], ['id'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('image_upload_url', schema=None) as batch_op:
        batch_op.drop_constraint(batch_op.f('fk_image_upload_url_parent_id_image_upload_url'), type_='foreignkey')
        batch_op.drop_column('totalParts')
        batch_op.drop_column('partNumber')
        batch_op.drop_column('parent_id')

    # ### end Alembic commands ###

<filename>backend/migrations/versions/3e2d8b975154_self_referential_uploads.py
"""self-referential uploads

Revision ID: 3e2d8b975154
Revises: 0<PASSWORD>
Create Date: 2021-01-13 13:51:16.349425

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3e2d8b975154'
down_revision = '00d6a016a0c0'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('image_upload_url', schema=None) as batch_op:
        batch_op.add_column(sa.Column('parent_id', sa.String(), nullable=True))
        batch_op.add_column(sa.Column('partNumber', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('totalParts', sa.Integer(), nullable=True))
        batch_op.create_foreign_key(batch_op.f('fk_image_upload_url_parent_id_image_upload_url'), 'image_upload_url', ['parent_id'], ['id'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('image_upload_url', schema=None) as batch_op:
        batch_op.drop_constraint(batch_op.f('fk_image_upload_url_parent_id_image_upload_url'), type_='foreignkey')
        batch_op.drop_column('totalParts')
        batch_op.drop_column('partNumber')
        batch_op.drop_column('parent_id')

    # ### end Alembic commands ###

self-referential uploads  Revision ID: 3e2d8b975154 Revises: 0<PASSWORD> Create Date: 2021-01-13 13:51:16.349425 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###