"""empty message

Revision ID: d93c0ac0293e
Revises: d82f2d53d8ba
Create Date: 2019-09-04 11:42:36.204703

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "d93c0ac0293e"
down_revision = "d82f2d53d8ba"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "assay_uploads",
        sa.Column(
            "gcs_file_map", postgresql.JSONB(astext_type=sa.Text()), nullable=False
        ),
    )
    op.create_index(
        "assay_uploads_gcs_gcs_file_map_idx",
        "assay_uploads",
        ["gcs_file_map"],
        unique=False,
        postgresql_using="gin",
    )
    op.drop_index("assay_uploads_gcs_file_uris_idx", table_name="assay_uploads")
    op.drop_column("assay_uploads", "gcs_file_uris")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "assay_uploads",
        sa.Column(
            "gcs_file_uris",
            postgresql.ARRAY(sa.VARCHAR()),
            autoincrement=False,
            nullable=False,
        ),
    )
    op.create_index(
        "assay_uploads_gcs_file_uris_idx",
        "assay_uploads",
        ["gcs_file_uris"],
        unique=False,
    )
    op.drop_index("assay_uploads_gcs_gcs_file_map_idx", table_name="assay_uploads")
    op.drop_column("assay_uploads", "gcs_file_map")
    # ### end Alembic commands ###
