"""initial migration

Revision ID: cd0e9c173a7f
Revises: 
Create Date: 2023-07-18 15:53:06.213349

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'cd0e9c173a7f'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('link', schema=None) as batch_op:
        batch_op.add_column(sa.Column('hit_count', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('owner_name', sa.String(length=255), nullable=True))
        batch_op.create_unique_constraint(None, ['name'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('link', schema=None) as batch_op:
        batch_op.drop_constraint(None, type_='unique')
        batch_op.drop_column('owner_name')
        batch_op.drop_column('hit_count')

    # ### end Alembic commands ###
