"""empty message

Revision ID: 5a3ce26f6b9c
Revises: None
Create Date: 2014-11-19 11:38:02.768518

"""

# revision identifiers, used by Alembic.
revision = '5a3ce26f6b9c'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('roles',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('default', sa.Boolean(), nullable=True),
    sa.Column('permissions', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_index('ix_roles_default', 'roles', ['default'], unique=False)
    op.create_table('species',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('speciesauthor', sa.String(length=64), nullable=True),
    sa.Column('kingdom', sa.String(length=64), nullable=True),
    sa.Column('phylum', sa.String(length=64), nullable=True),
    sa.Column('angiogymno', sa.String(length=64), nullable=True),
    sa.Column('dicotmonoc', sa.String(length=64), nullable=True),
    sa.Column('_class', sa.String(length=64), nullable=True),
    sa.Column('_order', sa.String(length=64), nullable=True),
    sa.Column('family', sa.String(length=64), nullable=True),
    sa.Column('genus', sa.String(length=64), nullable=True),
    sa.Column('ecoregion', sa.String(length=64), nullable=True),
    sa.Column('growthtype', sa.String(length=64), nullable=True),
    sa.Column('growthformraunkiaer', sa.String(length=64), nullable=True),
    sa.Column('annualperiodicity', sa.Integer(), nullable=True),
    sa.Column('planttype', sa.String(length=64), nullable=True),
    sa.Column('commonname', sa.String(length=64), nullable=True),
    sa.Column('originalimageurl', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('plant',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('matrixnumber', sa.Integer(), nullable=True),
    sa.Column('matrix', sa.Text(), nullable=True),
    sa.Column('dimension', sa.Integer(), nullable=True),
    sa.Column('matrixclassnumber', sa.Integer(), nullable=True),
    sa.Column('matrixclassorganised', sa.String(length=64), nullable=True),
    sa.Column('matrixsplit', sa.String(length=64), nullable=True),
    sa.Column('classnames', sa.Text(), nullable=True),
    sa.Column('observation', sa.String(length=250), nullable=True),
    sa.Column('matrixcomposite', sa.String(length=64), nullable=True),
    sa.Column('matrixtreatment', sa.String(length=84), nullable=True),
    sa.Column('matrixcaptivity', sa.String(length=10), nullable=True),
    sa.Column('matrixstartyear', sa.Integer(), nullable=True),
    sa.Column('matrixstartseason', sa.String(length=10), nullable=True),
    sa.Column('matrixstartmonth', sa.Integer(), nullable=True),
    sa.Column('matrixendyear', sa.Integer(), nullable=True),
    sa.Column('matrixendseason', sa.Integer(), nullable=True),
    sa.Column('matrixendmonth', sa.String(length=16), nullable=True),
    sa.Column('studiedsex', sa.String(length=4), nullable=True),
    sa.Column('population', sa.String(length=64), nullable=True),
    sa.Column('latdeg', sa.Integer(), nullable=True),
    sa.Column('latmin', sa.Integer(), nullable=True),
    sa.Column('latsec', sa.Integer(), nullable=True),
    sa.Column('londeg', sa.Integer(), nullable=True),
    sa.Column('lonmin', sa.Integer(), nullable=True),
    sa.Column('lonsec', sa.Integer(), nullable=True),
    sa.Column('latitudedec', sa.Integer(), nullable=True),
    sa.Column('longitudedec', sa.Integer(), nullable=True),
    sa.Column('altitude', sa.Integer(), nullable=True),
    sa.Column('country', sa.String(length=64), nullable=True),
    sa.Column('continent', sa.String(length=64), nullable=True),
    sa.Column('criteriasize', sa.String(length=64), nullable=True),
    sa.Column('criteriaontogeny', sa.String(length=64), nullable=True),
    sa.Column('authors', sa.String(length=64), nullable=True),
    sa.Column('journal', sa.String(length=64), nullable=True),
    sa.Column('yearpublication', sa.Integer(), nullable=True),
    sa.Column('doiisbn', sa.String(length=64), nullable=True),
    sa.Column('additionalsource', sa.String(length=200), nullable=True),
    sa.Column('enteredby', sa.String(length=64), nullable=True),
    sa.Column('entereddate', sa.String(length=64), nullable=True),
    sa.Column('source', sa.String(length=100), nullable=True),
    sa.Column('statusstudy', sa.String(length=64), nullable=True),
    sa.Column('statusstudyref', sa.String(length=64), nullable=True),
    sa.Column('statuselsewhere', sa.String(length=64), nullable=True),
    sa.Column('statuselsewhereref', sa.String(length=64), nullable=True),
    sa.Column('species_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['species_id'], ['species.name'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_plant_matrixnumber', 'plant', ['matrixnumber'], unique=True)
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=64), nullable=True),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('confirmed', sa.Boolean(), nullable=True),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('location', sa.String(length=64), nullable=True),
    sa.Column('about_me', sa.Text(), nullable=True),
    sa.Column('member_since', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_users_email', 'users', ['email'], unique=True)
    op.create_index('ix_users_username', 'users', ['username'], unique=True)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_users_username', 'users')
    op.drop_index('ix_users_email', 'users')
    op.drop_table('users')
    op.drop_index('ix_plant_matrixnumber', 'plant')
    op.drop_table('plant')
    op.drop_table('species')
    op.drop_index('ix_roles_default', 'roles')
    op.drop_table('roles')
    ### end Alembic commands ###
