"""v0.6.0 migration

Revision ID: 241bdc784fef
Revises: 1287b0e32297
Create Date: 2024-11-16 09:20:18.779220

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = '241bdc784fef'
down_revision: Union[str, None] = '1287b0e32297'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('activities', sa.Column('garminconnect_activity_id', sa.BigInteger(), nullable=True, comment='Garmin Connect activity ID'))
    op.create_unique_constraint(None, 'activities', ['garminconnect_activity_id'])
    op.add_column('users_integrations', sa.Column('garminconnect_oauth1', sa.JSON(), nullable=True))
    op.add_column('users_integrations', sa.Column('garminconnect_oauth2', sa.JSON(), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('users_integrations', 'garminconnect_oauth2')
    op.drop_column('users_integrations', 'garminconnect_oauth1')
    op.drop_constraint(None, 'activities', type_='unique')
    op.drop_column('activities', 'garminconnect_activity_id')
    # ### end Alembic commands ###
