"""update dataset field name

Revision ID: 732105cd54e3
Revises: e576b6a80a49
Create Date: 2021-10-01 06:48:22.449643

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

# revision identifiers, used by Alembic.
revision = "732105cd54e3"
down_revision = "e576b6a80a49"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "datasets", sa.Column("data_qualifiers", sa.ARRAY(sa.String()), nullable=True)
    )
    op.drop_column("datasets", "data_qualifier")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "datasets",
        sa.Column(
            "data_qualifier",
            postgresql.ARRAY(sa.VARCHAR()),
            autoincrement=False,
            nullable=True,
        ),
    )
    op.drop_column("datasets", "data_qualifiers")
    # ### end Alembic commands ###
