"""Initial autogenerated revision

Revision ID: 4f3f55688877
Revises: 
Create Date: 2015-07-18 23:05:18.333757

"""

# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = None
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('album',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=150), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('creationDate', sa.DateTime(), nullable=True),
    sa.Column('coverImageId', sa.Integer(), nullable=True),
    sa.Column('numImages', sa.Integer(), nullable=True),
    sa.Column('passwordHash', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('image',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('originalFilename', sa.String(length=150), nullable=True),
    sa.Column('uploadDate', sa.DateTime(), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('albumId', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['albumId'], ['album.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('image_instance',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('verticalResolution', sa.Integer(), nullable=True),
    sa.Column('horizontalResolution', sa.Integer(), nullable=True),
    sa.Column('mimeType', sa.String(length=20), nullable=True),
    sa.Column('isOriginal', sa.Boolean(), nullable=True),
    sa.Column('imageId', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['imageId'], ['image.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


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

"""Initial autogenerated revision

Revision ID: 4f3f55688877
Revises: 
Create Date: 2015-07-18 23:05:18.333757

"""

# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = None
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('album',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=150), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('creationDate', sa.DateTime(), nullable=True),
    sa.Column('coverImageId', sa.Integer(), nullable=True),
    sa.Column('numImages', sa.Integer(), nullable=True),
    sa.Column('passwordHash', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('image',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('originalFilename', sa.String(length=150), nullable=True),
    sa.Column('uploadDate', sa.DateTime(), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('albumId', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['albumId'], ['album.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('image_instance',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('verticalResolution', sa.Integer(), nullable=True),
    sa.Column('horizontalResolution', sa.Integer(), nullable=True),
    sa.Column('mimeType', sa.String(length=20), nullable=True),
    sa.Column('isOriginal', sa.Boolean(), nullable=True),
    sa.Column('imageId', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['imageId'], ['image.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###


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

Initial autogenerated revision  Revision ID: 4f3f55688877 Revises:  Create Date: 2015-07-18 23:05:18.333757 # 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 ###