"""Add ERC-20 tokens support

Revision ID: 58f6fcd5af80
Revises: 69b52fb159ed
Create Date: 2022-03-30 23:13:36.169360

"""
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "58f6fcd5af80"
down_revision = "69b52fb159ed"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("paymentmethods", sa.Column("symbol", sa.Text(), nullable=True))
    op.add_column("paymentmethods", sa.Column("contract", sa.Text(), nullable=True))
    op.add_column("paymentmethods", sa.Column("divisibility", sa.Integer(), nullable=True))
    op.execute("update paymentmethods set symbol=currency")
    op.execute("update paymentmethods set divisibility=8")
    op.add_column("wallets", sa.Column("contract", sa.Text(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("wallets", "contract")
    op.drop_column("paymentmethods", "divisibility")
    op.drop_column("paymentmethods", "contract")
    op.drop_column("paymentmethods", "symbol")
    # ### end Alembic commands ###
