"""promote help_req to table

Revision ID: 2480008ebdce
Revises: 59f85960778
Create Date: 2012-06-08 12:23:14.861858

"""

# revision identifiers, used by Alembic.
revision = '2480008ebdce'
down_revision = '59f85960778'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('help_req',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('article_id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['article_id'], ['article.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['useraccount.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_column(u'article', u'help_req_id')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'article', sa.Column(u'help_req_id', mysql.INTEGER(display_width=11), nullable=True))
    op.drop_table('help_req')
    ### end Alembic commands ###
