"""add b2_images table

Revision ID: e6c37c0c6006
Revises: 49921318845a
Create Date: 2020-02-21 21:11:37.041856

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "e6c37c0c6006"
down_revision = "49921318845a"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "b2_images",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("plugin", sa.Text(), nullable=False),
        sa.Column("extra", sa.Text(), nullable=True),
        sa.Column("deleted", sa.Boolean(), nullable=True),
        sa.Column("external_id", sa.Text(), nullable=False),
        sa.Column("file_name", sa.Text(), nullable=False),
        sa.Column("hash", sa.Text(), nullable=False),
        sa.Column("url", sa.Text(), nullable=False),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_b2_images")),
        sa.UniqueConstraint("external_id", name=op.f("uq_b2_images_external_id")),
        sa.UniqueConstraint("file_name", name=op.f("uq_b2_images_file_name")),
        sa.UniqueConstraint("hash", name=op.f("uq_b2_images_hash")),
        sa.UniqueConstraint("url", name=op.f("uq_b2_images_url")),
    )
    op.create_index(
        op.f("ix_b2_images_deleted"), "b2_images", ["deleted"], unique=False
    )
    op.create_index(op.f("ix_b2_images_extra"), "b2_images", ["extra"], unique=False)
    op.create_index(op.f("ix_b2_images_plugin"), "b2_images", ["plugin"], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_b2_images_plugin"), table_name="b2_images")
    op.drop_index(op.f("ix_b2_images_extra"), table_name="b2_images")
    op.drop_index(op.f("ix_b2_images_deleted"), table_name="b2_images")
    op.drop_table("b2_images")
    # ### end Alembic commands ###

"""add b2_images table

Revision ID: e6c37c0c6006
Revises: 49921318845a
Create Date: 2020-02-21 21:11:37.041856

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "e6c37c0c6006"
down_revision = "49921318845a"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "b2_images",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("plugin", sa.Text(), nullable=False),
        sa.Column("extra", sa.Text(), nullable=True),
        sa.Column("deleted", sa.Boolean(), nullable=True),
        sa.Column("external_id", sa.Text(), nullable=False),
        sa.Column("file_name", sa.Text(), nullable=False),
        sa.Column("hash", sa.Text(), nullable=False),
        sa.Column("url", sa.Text(), nullable=False),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_b2_images")),
        sa.UniqueConstraint("external_id", name=op.f("uq_b2_images_external_id")),
        sa.UniqueConstraint("file_name", name=op.f("uq_b2_images_file_name")),
        sa.UniqueConstraint("hash", name=op.f("uq_b2_images_hash")),
        sa.UniqueConstraint("url", name=op.f("uq_b2_images_url")),
    )
    op.create_index(
        op.f("ix_b2_images_deleted"), "b2_images", ["deleted"], unique=False
    )
    op.create_index(op.f("ix_b2_images_extra"), "b2_images", ["extra"], unique=False)
    op.create_index(op.f("ix_b2_images_plugin"), "b2_images", ["plugin"], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_b2_images_plugin"), table_name="b2_images")
    op.drop_index(op.f("ix_b2_images_extra"), table_name="b2_images")
    op.drop_index(op.f("ix_b2_images_deleted"), table_name="b2_images")
    op.drop_table("b2_images")
    # ### end Alembic commands ###

add b2_images table  Revision ID: e6c37c0c6006 Revises: 49921318845a Create Date: 2020-02-21 21:11:37.041856 # 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 ###