"""templates_media_user_preferred_view

Revision: 0192
Revision ID: b01140bf6710
Revises: 16a37635c0ed
Create Date: 2020-09-02 13:54:23.709035

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


# revision identifiers, used by Alembic.
revision = 'b01140bf6710'
down_revision = '16a37635c0ed'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('users', sa.Column('preferred_default_view', sa.String(), nullable=True))
    op.add_column('projects', sa.Column('template_preview_media_id', sa.Integer(), nullable=True))
    op.execute("UPDATE users SET preferred_default_view = 'kanban'")


def downgrade():
    op.drop_column('users', 'preferred_default_view')
    op.drop_column('projects', 'template_preview_media_id')
