"""Move Language col from User to UserSettings

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-06-24 10:51:58.562458

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5b1c342f1989'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user_settings', schema=None) as batch_op:
        batch_op.add_column(sa.Column('language', sa.Enum('EN', name='supportedlanguage'), nullable=True, comment='Preferred language of user'))

    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.drop_column('language')

    op.execute(
        "UPDATE user_settings SET language = 'EN'"
    )

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.add_column(sa.Column('language', sa.Enum('EN', name='supportedlanguage'), nullable=True, comment='Preferred language of user'))

    with op.batch_alter_table('user_settings', schema=None) as batch_op:
        batch_op.drop_column('language')

    op.execute(
        "UPDATE users SET language = 'EN'"
    )

    # ### end Alembic commands ###

"""Move Language col from User to UserSettings

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-06-24 10:51:58.562458

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5b1c342f1989'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user_settings', schema=None) as batch_op:
        batch_op.add_column(sa.Column('language', sa.Enum('EN', name='supportedlanguage'), nullable=True, comment='Preferred language of user'))

    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.drop_column('language')

    op.execute(
        "UPDATE user_settings SET language = 'EN'"
    )

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.add_column(sa.Column('language', sa.Enum('EN', name='supportedlanguage'), nullable=True, comment='Preferred language of user'))

    with op.batch_alter_table('user_settings', schema=None) as batch_op:
        batch_op.drop_column('language')

    op.execute(
        "UPDATE users SET language = 'EN'"
    )

    # ### end Alembic commands ###

Move Language col from User to UserSettings  Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2021-06-24 10:51:58.562458 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###