"""empty message

Revision ID: 916493e06e14
Revises: cab073051c53
Create Date: 2021-08-05 19:45:25.069253

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '916493e06e14'
down_revision = 'cab073051c53'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cars',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('name', sa.String(length=150), nullable=True),
    sa.Column('description', sa.String(length=200), nullable=True),
    sa.Column('price', sa.Numeric(precision=10, scale=2), nullable=True),
    sa.Column('range', sa.String(length=150), nullable=True),
    sa.Column('passengers', sa.String(length=50), nullable=True),
    sa.Column('cost_of_prod', sa.Numeric(precision=10, scale=2), nullable=True),
    sa.Column('user_token', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['user_token'], ['user.token'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column('user', 'password',
               existing_type=sa.VARCHAR(),
               nullable=False)
    op.create_unique_constraint(None, 'user', ['email'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'user', type_='unique')
    op.alter_column('user', 'password',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.drop_table('cars')
    # ### end Alembic commands ###
