"""empty message

Revision ID: 56c689702a23
Revises: 62bab0024fac
Create Date: 2016-07-03 04:40:37.351139

"""

# revision identifiers, used by Alembic.
revision = '56c689702a23'
down_revision = '62bab0024fac'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('resultdatapoints',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('value', sa.Float(), nullable=True),
    sa.Column('prediction', sa.Float(), nullable=True),
    sa.Column('job_id', sa.Integer(), nullable=True),
    sa.Column('datapoint_id', sa.Integer(), nullable=True),
    sa.Column('dataset_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['datapoint_id'], ['datapoints.id'], ),
    sa.ForeignKeyConstraint(['dataset_id'], ['datasets.id'], ),
    sa.ForeignKeyConstraint(['job_id'], ['sz_job.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_resultdatapoints_datapoint_id'), 'resultdatapoints', ['datapoint_id'], unique=False)
    op.create_index(op.f('ix_resultdatapoints_dataset_id'), 'resultdatapoints', ['dataset_id'], unique=False)
    op.create_index(op.f('ix_resultdatapoints_timestamp'), 'resultdatapoints', ['timestamp'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_resultdatapoints_timestamp'), table_name='resultdatapoints')
    op.drop_index(op.f('ix_resultdatapoints_dataset_id'), table_name='resultdatapoints')
    op.drop_index(op.f('ix_resultdatapoints_datapoint_id'), table_name='resultdatapoints')
    op.drop_table('resultdatapoints')
    ### end Alembic commands ###
