"""add lat and lng

Revision ID: fbf3995d36c6
Revises: 4ced2a6ff605
Create Date: 2021-06-13 22:49:46.231443

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'fbf3995d36c6'
down_revision = '4ced2a6ff605'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('gyms', sa.Column('lat', sa.Float(), nullable=False))
    op.add_column('gyms', sa.Column('lng', sa.Float(), nullable=False))
    op.alter_column('users', 'available_credit',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('users', 'is_owner',
               existing_type=sa.BOOLEAN(),
               nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', 'is_owner',
               existing_type=sa.BOOLEAN(),
               nullable=False)
    op.alter_column('users', 'available_credit',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_column('gyms', 'lng')
    op.drop_column('gyms', 'lat')
    # ### end Alembic commands ###
