"""updated_at_prop_for_views

Revision: 0122
Revision ID: 9e0835454e9
Revises: 3cb0832a6d79
Create Date: 2018-01-15 18:45:57.728177

"""

# revision identifiers, used by Alembic.
revision = '9e0835454e9'
down_revision = '3cb0832a6d79'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.add_column('views', sa.Column('updated_at', sa.DateTime(), nullable=True))

    op.execute("""UPDATE views SET updated_at = created_at""")


def downgrade():
    op.drop_column('views', 'updated_at')
