"""empty message

Revision ID: a890ff05d489
Revises: fbe3a0c677b4
Create Date: 2020-06-19 18:09:49.537804

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'a890ff05d489'
down_revision = 'fbe3a0c677b4'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False, comment='ID пользователя'),
    sa.Column('login', sa.String(), nullable=False, comment='Логин пользователя'),
    sa.Column('password', sa.LargeBinary(), nullable=False, comment='Пароль пользователя'),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column('assessments', 'id',
               existing_type=postgresql.UUID(),
               comment='ID оценки',
               existing_server_default=sa.text('uuid_generate_v4()'))
    op.alter_column('assessments', 'photo_id',
               existing_type=postgresql.UUID(),
               comment='ID фотографии.',
               existing_nullable=True)
    op.alter_column('assessments', 'rating',
               existing_type=postgresql.DOUBLE_PRECISION(precision=53),
               comment='Рейтинг фотографии.',
               existing_nullable=True)
    op.alter_column('photos', 'id',
               existing_type=postgresql.UUID(),
               comment='Id photo.',
               existing_server_default=sa.text('uuid_generate_v4()'))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('photos', 'id',
               existing_type=postgresql.UUID(),
               comment=None,
               existing_comment='Id photo.',
               existing_server_default=sa.text('uuid_generate_v4()'))
    op.alter_column('assessments', 'rating',
               existing_type=postgresql.DOUBLE_PRECISION(precision=53),
               comment=None,
               existing_comment='Рейтинг фотографии.',
               existing_nullable=True)
    op.alter_column('assessments', 'photo_id',
               existing_type=postgresql.UUID(),
               comment=None,
               existing_comment='ID фотографии.',
               existing_nullable=True)
    op.alter_column('assessments', 'id',
               existing_type=postgresql.UUID(),
               comment=None,
               existing_comment='ID оценки',
               existing_server_default=sa.text('uuid_generate_v4()'))
    op.drop_table('users')
    # ### end Alembic commands ###
