"""Initial db state

Revision ID: 232613356081
Revises: None
Create Date: 2014-11-02 13:12:20.572935

"""

# revision identifiers, used by Alembic.
revision = '232613356081'
message =" 'hello"
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user_stats',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('created_time', sa.DateTime(), nullable=True),
        sa.Column('search_provider', sa.String(length=64), nullable=True),
        sa.Column('beneficiary', sa.String(length=64), nullable=True),
        sa.Column('ad_network', sa.String(length=64), nullable=True),
        sa.Column('advertising_off', sa.Boolean(), nullable=True),
        sa.Column('queries_made', sa.Integer(), nullable=True),
        sa.Column('ads_clicked', sa.Integer(), nullable=True),
        sa.Column('money_generated', sa.Float(), nullable=True),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('email', sa.String(length=64), nullable=False),
        sa.Column('created_time', sa.DateTime(), nullable=True),
        sa.Column('activation_key', sa.String(length=64), nullable=True),
        sa.Column('status_code', sa.SmallInteger(), nullable=True),
        sa.Column('user_stats_id', sa.Integer(), nullable=True),
        sa.Column('role_code', sa.SmallInteger(), nullable=False),
        sa.Column('password', sa.String(length=255), nullable=False),
        sa.ForeignKeyConstraint(['user_stats_id'], ['user_stats.id'], ),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('email')
    )
    ### end Alembic commands ###


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