"""tabela cliente

Revision ID: <PASSWORD>
Revises: <PASSWORD>
Create Date: 2022-04-20 23:10:26.916883

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = '<PASSWORD>'
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=400), nullable=False),
    sa.Column('email', sa.String(length=100), nullable=False),
    sa.Column('senha', sa.String(length=100), nullable=False),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_cliente')),
    sa.UniqueConstraint('email', name=op.f('uq_cliente_email'))
    )
    op.drop_table('conversa')
    op.drop_table('usuario')
    op.drop_table('mensagem')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('mensagem',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('texto', sa.VARCHAR(length=144), nullable=False),
    sa.Column('remetente', sa.INTEGER(), nullable=False),
    sa.Column('conversa_id', sa.INTEGER(), nullable=True),
    sa.ForeignKeyConstraint(['conversa_id'], ['conversa.id'], name='fk_mensagem_conversa_id_conversa'),
    sa.ForeignKeyConstraint(['remetente'], ['usuario.id'], name='fk_mensagem_remetente_usuario'),
    sa.PrimaryKeyConstraint('id', name='pk_mensagem')
    )
    op.create_table('usuario',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('nome', sa.VARCHAR(length=30), nullable=False),
    sa.Column('senha', sa.VARCHAR(length=100), nullable=False),
    sa.Column('nome_completo', sa.VARCHAR(length=400), nullable=True),
    sa.PrimaryKeyConstraint('id', name='pk_usuario'),
    sa.UniqueConstraint('nome', name='uq_usuario_nome')
    )
    op.create_table('conversa',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('part_a_id', sa.INTEGER(), nullable=False),
    sa.Column('part_b_id', sa.INTEGER(), nullable=False),
    sa.ForeignKeyConstraint(['part_a_id'], ['usuario.id'], name='fk_conversa_part_a_id_usuario'),
    sa.ForeignKeyConstraint(['part_b_id'], ['usuario.id'], name='fk_conversa_part_b_id_usuario'),
    sa.PrimaryKeyConstraint('id', name='pk_conversa')
    )
    op.drop_table('cliente')
    # ### end Alembic commands ###

"""tabela cliente

Revision ID: <PASSWORD>
Revises: <PASSWORD>
Create Date: 2022-04-20 23:10:26.916883

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = '<PASSWORD>'
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=400), nullable=False),
    sa.Column('email', sa.String(length=100), nullable=False),
    sa.Column('senha', sa.String(length=100), nullable=False),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_cliente')),
    sa.UniqueConstraint('email', name=op.f('uq_cliente_email'))
    )
    op.drop_table('conversa')
    op.drop_table('usuario')
    op.drop_table('mensagem')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('mensagem',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('texto', sa.VARCHAR(length=144), nullable=False),
    sa.Column('remetente', sa.INTEGER(), nullable=False),
    sa.Column('conversa_id', sa.INTEGER(), nullable=True),
    sa.ForeignKeyConstraint(['conversa_id'], ['conversa.id'], name='fk_mensagem_conversa_id_conversa'),
    sa.ForeignKeyConstraint(['remetente'], ['usuario.id'], name='fk_mensagem_remetente_usuario'),
    sa.PrimaryKeyConstraint('id', name='pk_mensagem')
    )
    op.create_table('usuario',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('nome', sa.VARCHAR(length=30), nullable=False),
    sa.Column('senha', sa.VARCHAR(length=100), nullable=False),
    sa.Column('nome_completo', sa.VARCHAR(length=400), nullable=True),
    sa.PrimaryKeyConstraint('id', name='pk_usuario'),
    sa.UniqueConstraint('nome', name='uq_usuario_nome')
    )
    op.create_table('conversa',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('part_a_id', sa.INTEGER(), nullable=False),
    sa.Column('part_b_id', sa.INTEGER(), nullable=False),
    sa.ForeignKeyConstraint(['part_a_id'], ['usuario.id'], name='fk_conversa_part_a_id_usuario'),
    sa.ForeignKeyConstraint(['part_b_id'], ['usuario.id'], name='fk_conversa_part_b_id_usuario'),
    sa.PrimaryKeyConstraint('id', name='pk_conversa')
    )
    op.drop_table('cliente')
    # ### end Alembic commands ###

tabela cliente  Revision ID: <PASSWORD> Revises: <PASSWORD> Create Date: 2022-04-20 23:10:26.916883 # 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 ###