"""user_app_params

Revision: 0144
Revision ID: 3bcdc4dfe14c
Revises: 10f9a04dddda
Create Date: 2018-09-28 18:18:36.842151

"""

# revision identifiers, used by Alembic.
revision = '3bcdc4dfe14c'
down_revision = '10f9a04dddda'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


def upgrade():
    op.add_column('users', sa.Column('app_params', postgresql.JSON(), nullable=True))
    op.execute("UPDATE users SET app_params='{\"theme\":\"topbar\"}'::json")


def downgrade():
    op.drop_column('users', 'app_params')
