"""introduce private project and roles

Revision ID: 2b269c4557de
Revises: 3c486a5dcceb
Create Date: 2014-02-25 23:16:30.479004

"""

# revision identifiers, used by Alembic.
revision = '2b269c4557de'
down_revision = '3c486a5dcceb'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('role',
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('reader', sa.Boolean(), nullable=True),
    sa.Column('editor', sa.Boolean(), nullable=True),
    sa.Column('admin', sa.Boolean(), nullable=True),
    sa.Column('account_id', sa.Integer(), nullable=True),
    sa.Column('project_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['account_id'], ['account.id'], ),
    sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column(u'project', sa.Column('private', sa.Boolean(), nullable=True))
    ### end Alembic commands ###


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