"""Support private

Revision ID: 541d041d662a
Revises: 72f7db0e7dfe
Create Date: 2020-07-09 16:11:47.498579

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '541d041d662a'
down_revision = '72f7db0e7dfe'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('experiment', sa.Column(
        'private', sa.Boolean(), nullable=True))

    # Let's make every experiment we've done so far private so we don't leak any
    # nonpublic experiments we've done, the ones we want we can mark as
    # nonprivate.
    op.execute('UPDATE experiment SET private = true')
    op.alter_column('experiment', 'private', nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('experiment', 'private')
    # ### end Alembic commands ###
