"""Initial migration

Revision ID: 26a638cccab0
Revises: None
Create Date: 2015-03-18 16:19:34.991882

"""

# revision identifiers, used by Alembic.
revision = '26a638cccab0'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('extension',
    sa.Column('id', sa.String(length=40), nullable=False),
    sa.Column('avg_rank', sa.Float(), nullable=True),
    sa.Column('created_datetime', sa.DateTime(), nullable=True),
    sa.Column('updated_datetime', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_extension_created_datetime'), 'extension', ['created_datetime'], unique=False)
    op.create_index(op.f('ix_extension_updated_datetime'), 'extension', ['updated_datetime'], unique=False)
    op.create_table('extension_query',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('extension_id', sa.String(length=40), nullable=True),
    sa.Column('category', sa.String(length=100), nullable=True),
    sa.Column('search_term', sa.String(length=200), nullable=True),
    sa.Column('hl', sa.String(length=10), nullable=True),
    sa.Column('gl', sa.String(length=2), nullable=True),
    sa.Column('created_datetime', sa.DateTime(), nullable=True),
    sa.Column('updated_datetime', sa.DateTime(), nullable=True),
    sa.Column('status', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['extension_id'], ['extension.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_extension_query_category'), 'extension_query', ['category'], unique=False)
    op.create_index(op.f('ix_extension_query_created_datetime'), 'extension_query', ['created_datetime'], unique=False)
    op.create_index(op.f('ix_extension_query_gl'), 'extension_query', ['gl'], unique=False)
    op.create_index(op.f('ix_extension_query_hl'), 'extension_query', ['hl'], unique=False)
    op.create_index(op.f('ix_extension_query_search_term'), 'extension_query', ['search_term'], unique=False)
    op.create_index(op.f('ix_extension_query_status'), 'extension_query', ['status'], unique=False)
    op.create_index(op.f('ix_extension_query_updated_datetime'), 'extension_query', ['updated_datetime'], unique=False)
    op.create_table('extension_rank',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('extension_id', sa.String(length=40), nullable=True),
    sa.Column('extension_query_id', sa.Integer(), nullable=True),
    sa.Column('position', sa.Integer(), nullable=True),
    sa.Column('created_datetime', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['extension_id'], ['extension.id'], ),
    sa.ForeignKeyConstraint(['extension_query_id'], ['extension_query.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_extension_rank_created_datetime'), 'extension_rank', ['created_datetime'], unique=False)
    op.create_index(op.f('ix_extension_rank_position'), 'extension_rank', ['position'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_extension_rank_position'), table_name='extension_rank')
    op.drop_index(op.f('ix_extension_rank_created_datetime'), table_name='extension_rank')
    op.drop_table('extension_rank')
    op.drop_index(op.f('ix_extension_query_updated_datetime'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_status'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_search_term'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_hl'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_gl'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_created_datetime'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_category'), table_name='extension_query')
    op.drop_table('extension_query')
    op.drop_index(op.f('ix_extension_updated_datetime'), table_name='extension')
    op.drop_index(op.f('ix_extension_created_datetime'), table_name='extension')
    op.drop_table('extension')
    ### end Alembic commands ###

"""Initial migration

Revision ID: 26a638cccab0
Revises: None
Create Date: 2015-03-18 16:19:34.991882

"""

# revision identifiers, used by Alembic.
revision = '26a638cccab0'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('extension',
    sa.Column('id', sa.String(length=40), nullable=False),
    sa.Column('avg_rank', sa.Float(), nullable=True),
    sa.Column('created_datetime', sa.DateTime(), nullable=True),
    sa.Column('updated_datetime', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_extension_created_datetime'), 'extension', ['created_datetime'], unique=False)
    op.create_index(op.f('ix_extension_updated_datetime'), 'extension', ['updated_datetime'], unique=False)
    op.create_table('extension_query',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('extension_id', sa.String(length=40), nullable=True),
    sa.Column('category', sa.String(length=100), nullable=True),
    sa.Column('search_term', sa.String(length=200), nullable=True),
    sa.Column('hl', sa.String(length=10), nullable=True),
    sa.Column('gl', sa.String(length=2), nullable=True),
    sa.Column('created_datetime', sa.DateTime(), nullable=True),
    sa.Column('updated_datetime', sa.DateTime(), nullable=True),
    sa.Column('status', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['extension_id'], ['extension.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_extension_query_category'), 'extension_query', ['category'], unique=False)
    op.create_index(op.f('ix_extension_query_created_datetime'), 'extension_query', ['created_datetime'], unique=False)
    op.create_index(op.f('ix_extension_query_gl'), 'extension_query', ['gl'], unique=False)
    op.create_index(op.f('ix_extension_query_hl'), 'extension_query', ['hl'], unique=False)
    op.create_index(op.f('ix_extension_query_search_term'), 'extension_query', ['search_term'], unique=False)
    op.create_index(op.f('ix_extension_query_status'), 'extension_query', ['status'], unique=False)
    op.create_index(op.f('ix_extension_query_updated_datetime'), 'extension_query', ['updated_datetime'], unique=False)
    op.create_table('extension_rank',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('extension_id', sa.String(length=40), nullable=True),
    sa.Column('extension_query_id', sa.Integer(), nullable=True),
    sa.Column('position', sa.Integer(), nullable=True),
    sa.Column('created_datetime', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['extension_id'], ['extension.id'], ),
    sa.ForeignKeyConstraint(['extension_query_id'], ['extension_query.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_extension_rank_created_datetime'), 'extension_rank', ['created_datetime'], unique=False)
    op.create_index(op.f('ix_extension_rank_position'), 'extension_rank', ['position'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_extension_rank_position'), table_name='extension_rank')
    op.drop_index(op.f('ix_extension_rank_created_datetime'), table_name='extension_rank')
    op.drop_table('extension_rank')
    op.drop_index(op.f('ix_extension_query_updated_datetime'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_status'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_search_term'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_hl'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_gl'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_created_datetime'), table_name='extension_query')
    op.drop_index(op.f('ix_extension_query_category'), table_name='extension_query')
    op.drop_table('extension_query')
    op.drop_index(op.f('ix_extension_updated_datetime'), table_name='extension')
    op.drop_index(op.f('ix_extension_created_datetime'), table_name='extension')
    op.drop_table('extension')
    ### end Alembic commands ###

Initial migration  Revision ID: 26a638cccab0 Revises: None Create Date: 2015-03-18 16:19:34.991882 # 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 ###