"""Create ObjectObjective, ObjectSection, ObjectControl

Revision ID: 3a5ff1d71b9f
Revises: 4155c544acb5
Create Date: 2013-07-28 03:00:07.564393

"""

# revision identifiers, used by Alembic.
revision = '3a5ff1d71b9f'
down_revision = '4155c544acb5'

from alembic import op
import sqlalchemy as sa

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('object_objectives',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('modified_by_id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('start_date', sa.DateTime(), nullable=True),
    sa.Column('end_date', sa.DateTime(), nullable=True),
    sa.Column('role', sa.String(length=250), nullable=True),
    sa.Column('notes', sa.Text(), nullable=True),
    sa.Column('objective_id', sa.Integer(), nullable=False),
    sa.Column('objectiveable_id', sa.Integer(), nullable=True),
    sa.Column('objectiveable_type', sa.String(length=250), nullable=True),
    sa.Column('context_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['context_id'], ['contexts.id'], ),
    sa.ForeignKeyConstraint(['objective_id'], ['objectives.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('object_controls',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('modified_by_id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('start_date', sa.DateTime(), nullable=True),
    sa.Column('end_date', sa.DateTime(), nullable=True),
    sa.Column('role', sa.String(length=250), nullable=True),
    sa.Column('notes', sa.Text(), nullable=True),
    sa.Column('control_id', sa.Integer(), nullable=False),
    sa.Column('controllable_id', sa.Integer(), nullable=True),
    sa.Column('controllable_type', sa.String(length=250), nullable=True),
    sa.Column('context_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['context_id'], ['contexts.id'], ),
    sa.ForeignKeyConstraint(['control_id'], ['controls.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('object_sections',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('modified_by_id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('start_date', sa.DateTime(), nullable=True),
    sa.Column('end_date', sa.DateTime(), nullable=True),
    sa.Column('role', sa.String(length=250), nullable=True),
    sa.Column('notes', sa.Text(), nullable=True),
    sa.Column('section_id', sa.Integer(), nullable=False),
    sa.Column('sectionable_id', sa.Integer(), nullable=True),
    sa.Column('sectionable_type', sa.String(length=250), nullable=True),
    sa.Column('context_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['context_id'], ['contexts.id'], ),
    sa.ForeignKeyConstraint(['section_id'], ['sections.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('object_sections')
    op.drop_table('object_controls')
    op.drop_table('object_objectives')
    ### end Alembic commands ###

@@ -85,28 +85,28 @@
 evises: 
-4155c544acb5
+5459dba4c5e9
 %0ACreate 
@@ -232,20 +232,20 @@
  = '
-4155c544acb5
+5459dba4c5e9
 '%0A%0Af

Update migration identifier