"""empty message

Revision ID: d4e7caaff770
Revises: 
Create Date: 2021-07-22 20:06:59.378571

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cliente',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome', sa.String(length=100), nullable=False),
    sa.Column('criado', sa.DateTime(timezone=6), nullable=False),
    sa.Column('atualizado', sa.DateTime(timezone=6), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('produto',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome', sa.String(length=100), nullable=False),
    sa.Column('valor', sa.Numeric(precision=10, scale=2), nullable=False),
    sa.Column('imagem', sa.Text(), nullable=False),
    sa.Column('qtd', sa.Integer(), nullable=True),
    sa.Column('criado', sa.DateTime(timezone=6), nullable=False),
    sa.Column('atualizado', sa.DateTime(timezone=6), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('vendedor',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome', sa.String(length=100), nullable=False),
    sa.Column('criado', sa.DateTime(timezone=6), nullable=False),
    sa.Column('atualizado', sa.DateTime(timezone=6), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('venda',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('vendedor', sa.Integer(), nullable=False),
    sa.Column('data_hora', sa.DateTime(timezone=6), nullable=False),
    sa.Column('cliente', sa.Integer(), nullable=False),
    sa.Column('item', sa.Integer(), nullable=False),
    sa.Column('quantidade', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['cliente'], ['cliente.id'], ),
    sa.ForeignKeyConstraint(['item'], ['produto.id'], ),
    sa.ForeignKeyConstraint(['vendedor'], ['vendedor.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('venda')
    op.drop_table('vendedor')
    op.drop_table('produto')
    op.drop_table('cliente')
    # ### end Alembic commands ###
