"""add figshare update article

Revision ID: 3b8cc444f691
Revises: e04e7eb4fb16
Create Date: 2020-04-29 11:56:21.180582

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "3b8cc444f691"
down_revision = "e04e7eb4fb16"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "figshare_dataset_version_links",
        sa.Column("figshare_article_version", sa.Integer(), nullable=False),
    )
    # ### end Alembic commands ###

    # There are currently no entries for this table, but if there were, we only had
    # article creation up until this point.
    op.execute("update figshare_dataset_version_links set figshare_article_version = 1")


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("figshare_dataset_version_links", "figshare_article_version")
    # ### end Alembic commands ###
