"""empty message

Revision ID: 50da86128cfc
Revises: <PASSWORD>
Create Date: 2016-03-02 10:30:34.047000

"""

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'

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


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('interventions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('name', sa.Text(), nullable=False),
                    sa.Column('description', sa.Text(), nullable=False),
                    sa.Column('client_id', sa.String(
                        length=40), nullable=True),
                    sa.Column('card_html', sa.Text(), nullable=True),
                    sa.Column('card_url', sa.Text(), nullable=True),
                    sa.Column('public_access', sa.Boolean(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['client_id'], ['clients.client_id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_table('user_interventions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('access', postgresql.ENUM(
                        'forbidden', 'granted', name='access'), nullable=True),
                    sa.Column('card_html', sa.Text(), nullable=True),
                    sa.Column('user_id', sa.Integer(), nullable=True),
                    sa.Column('intervention_id', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(['intervention_id'], [
                                            'interventions.id'], ),
                    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_interventions')
    op.drop_table('interventions')
    op.execute("DROP TYPE access")
    ### end Alembic commands ###

"""empty message

Revision ID: 50da86128cfc
Revises: <PASSWORD>
Create Date: 2016-03-02 10:30:34.047000

"""

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'

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


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('interventions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('name', sa.Text(), nullable=False),
                    sa.Column('description', sa.Text(), nullable=False),
                    sa.Column('client_id', sa.String(
                        length=40), nullable=True),
                    sa.Column('card_html', sa.Text(), nullable=True),
                    sa.Column('card_url', sa.Text(), nullable=True),
                    sa.Column('public_access', sa.Boolean(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['client_id'], ['clients.client_id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_table('user_interventions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('access', postgresql.ENUM(
                        'forbidden', 'granted', name='access'), nullable=True),
                    sa.Column('card_html', sa.Text(), nullable=True),
                    sa.Column('user_id', sa.Integer(), nullable=True),
                    sa.Column('intervention_id', sa.Integer(), nullable=True),
                    sa.ForeignKeyConstraint(['intervention_id'], [
                                            'interventions.id'], ),
                    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_interventions')
    op.drop_table('interventions')
    op.execute("DROP TYPE access")
    ### end Alembic commands ###

empty message  Revision ID: 50da86128cfc Revises: <PASSWORD> Create Date: 2016-03-02 10:30:34.047000 # revision identifiers, used by Alembic. ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ###