"""empty message

Revision ID: 6a5d6b8f2d27
Revises: None
Create Date: 2016-05-12 18:48:06.996525

"""

# revision identifiers, used by Alembic.
revision = '6a5d6b8f<PASSWORD>'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('servers',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('server_token', sa.String(), nullable=True),
    sa.Column('server_id', sa.String(), nullable=True),
    sa.Column('server_name', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('server_token')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.Column('user_name', sa.String(), nullable=True),
    sa.Column('user_email', sa.String(), nullable=True),
    sa.Column('server_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['server_id'], ['servers.server_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('user_id')
    )
    op.create_table('access',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('auth_token', sa.String(), nullable=True),
    sa.Column('creation_date', sa.DateTime(), nullable=True),
    sa.Column('expiration_date', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('auth_token')
    )
    op.create_table('samples',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('sample_name', sa.String(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('sample_name', 'user_id', name='sample_id')
    )
    op.create_table('files',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('identifier', sa.String(), nullable=True),
    sa.Column('filename', sa.String(), nullable=True),
    sa.Column('total_size', sa.Integer(), nullable=True),
    sa.Column('file_type', sa.String(), nullable=True),
    sa.Column('readset', sa.String(), nullable=True),
    sa.Column('platform', sa.String(), nullable=True),
    sa.Column('run_type', sa.String(), nullable=True),
    sa.Column('capture_kit', sa.String(), nullable=True),
    sa.Column('library', sa.String(), nullable=True),
    sa.Column('reference', sa.String(), nullable=True),
    sa.Column('upload_status', sa.String(), nullable=True),
    sa.Column('upload_start_date', sa.DateTime(), nullable=True),
    sa.Column('upload_end_date', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.Column('access_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['access_id'], ['access.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('identifier')
    )
    op.create_table('runs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('readset', sa.String(), nullable=True),
    sa.Column('library', sa.String(), nullable=True),
    sa.Column('run_type', sa.String(), nullable=True),
    sa.Column('bed', sa.String(), nullable=True),
    sa.Column('fastq1', sa.String(), nullable=True),
    sa.Column('fastq2', sa.String(), nullable=True),
    sa.Column('bam', sa.String(), nullable=True),
    sa.Column('status', sa.String(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.Column('sample_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['sample_id'], ['samples.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('sample_file_link',
    sa.Column('sample_id', sa.Integer(), nullable=True),
    sa.Column('file_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['file_id'], ['files.id'], ),
    sa.ForeignKeyConstraint(['sample_id'], ['samples.id'], )
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('sample_file_link')
    op.drop_table('runs')
    op.drop_table('files')
    op.drop_table('samples')
    op.drop_table('access')
    op.drop_table('users')
    op.drop_table('servers')
    ### end Alembic commands ###

"""empty message

Revision ID: 6a5d6b8f2d27
Revises: None
Create Date: 2016-05-12 18:48:06.996525

"""

# revision identifiers, used by Alembic.
revision = '6a5d6b8f<PASSWORD>'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('servers',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('server_token', sa.String(), nullable=True),
    sa.Column('server_id', sa.String(), nullable=True),
    sa.Column('server_name', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('server_token')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.Column('user_name', sa.String(), nullable=True),
    sa.Column('user_email', sa.String(), nullable=True),
    sa.Column('server_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['server_id'], ['servers.server_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('user_id')
    )
    op.create_table('access',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('auth_token', sa.String(), nullable=True),
    sa.Column('creation_date', sa.DateTime(), nullable=True),
    sa.Column('expiration_date', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('auth_token')
    )
    op.create_table('samples',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('sample_name', sa.String(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('sample_name', 'user_id', name='sample_id')
    )
    op.create_table('files',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('identifier', sa.String(), nullable=True),
    sa.Column('filename', sa.String(), nullable=True),
    sa.Column('total_size', sa.Integer(), nullable=True),
    sa.Column('file_type', sa.String(), nullable=True),
    sa.Column('readset', sa.String(), nullable=True),
    sa.Column('platform', sa.String(), nullable=True),
    sa.Column('run_type', sa.String(), nullable=True),
    sa.Column('capture_kit', sa.String(), nullable=True),
    sa.Column('library', sa.String(), nullable=True),
    sa.Column('reference', sa.String(), nullable=True),
    sa.Column('upload_status', sa.String(), nullable=True),
    sa.Column('upload_start_date', sa.DateTime(), nullable=True),
    sa.Column('upload_end_date', sa.DateTime(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.Column('access_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['access_id'], ['access.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('identifier')
    )
    op.create_table('runs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('readset', sa.String(), nullable=True),
    sa.Column('library', sa.String(), nullable=True),
    sa.Column('run_type', sa.String(), nullable=True),
    sa.Column('bed', sa.String(), nullable=True),
    sa.Column('fastq1', sa.String(), nullable=True),
    sa.Column('fastq2', sa.String(), nullable=True),
    sa.Column('bam', sa.String(), nullable=True),
    sa.Column('status', sa.String(), nullable=True),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.Column('sample_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['sample_id'], ['samples.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('sample_file_link',
    sa.Column('sample_id', sa.Integer(), nullable=True),
    sa.Column('file_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['file_id'], ['files.id'], ),
    sa.ForeignKeyConstraint(['sample_id'], ['samples.id'], )
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('sample_file_link')
    op.drop_table('runs')
    op.drop_table('files')
    op.drop_table('samples')
    op.drop_table('access')
    op.drop_table('users')
    op.drop_table('servers')
    ### end Alembic commands ###

empty message  Revision ID: 6a5d6b8f2d27 Revises: None Create Date: 2016-05-12 18:48:06.996525 # 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 ###