"""initial App and User tables

Revision ID: 3cd7518e6d87
Revises: 
Create Date: 2015-03-05 14:43:52.007028

"""

# revision identifiers, used by Alembic.
revision = '3cd7518e6d87'
down_revision = None
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('uuid', sqlalchemy_utils.types.uuid.UUIDType(binary=False), nullable=False),
    sa.Column('username', sa.Unicode(length=255), nullable=True),
    sa.Column('password', sqlalchemy_utils.types.password.PasswordType(max_length=1094), nullable=True),
    sa.Column('app_data', sqlalchemy_utils.types.json.JSONType(), nullable=True),
    sa.PrimaryKeyConstraint('uuid'),
    sa.UniqueConstraint('username')
    )
    op.create_table('apps',
    sa.Column('uuid', sqlalchemy_utils.types.uuid.UUIDType(binary=False), nullable=False),
    sa.Column('title', sa.Unicode(length=255), nullable=False),
    sa.Column('password', sqlalchemy_utils.types.password.PasswordType(max_length=1094), nullable=False),
    sa.Column('groups', sqlalchemy_utils.types.scalar_list.ScalarListType(), nullable=True),
    sa.PrimaryKeyConstraint('uuid')
    )
    ### end Alembic commands ###


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