"""empty message

Revision ID: d9c9512758a6
Revises: 
Create Date: 2021-05-10 16:20:44.375731

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('status',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('status', sa.String(length=55), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('tipo_de_servico',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome_servico', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('usuario',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome', sa.String(length=255), nullable=False),
    sa.Column('cpf', sa.String(length=14), nullable=False),
    sa.Column('data_de_nascimento', sa.Date(), nullable=False),
    sa.Column('email', sa.String(length=255), nullable=False),
    sa.Column('senha', sa.String(length=255), nullable=False),
    sa.Column('telefone', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_usuario_email'), 'usuario', ['email'], unique=True)
    op.create_table('endereco',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('rua', sa.String(length=255), nullable=False),
    sa.Column('numero', sa.String(length=11), nullable=False),
    sa.Column('bairro', sa.String(length=255), nullable=False),
    sa.Column('cep', sa.String(length=11), nullable=False),
    sa.Column('referencia', sa.String(length=255), nullable=False),
    sa.Column('usuario_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['usuario_id'], ['usuario.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('ordem_de_serviço',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('data_solicitacao', sa.Date(), nullable=False),
    sa.Column('data_conclusao', sa.Date(), nullable=True),
    sa.Column('descricao', sa.String(length=511), nullable=False),
    sa.Column('imagem', sa.String(length=255), nullable=False),
    sa.Column('usuario_id', sa.Integer(), nullable=True),
    sa.Column('tipo_de_servico_id', sa.Integer(), nullable=True),
    sa.Column('status', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['status'], ['status.id'], ),
    sa.ForeignKeyConstraint(['tipo_de_servico_id'], ['tipo_de_servico.id'], ),
    sa.ForeignKeyConstraint(['usuario_id'], ['usuario.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('ordem_de_serviço')
    op.drop_table('endereco')
    op.drop_index(op.f('ix_usuario_email'), table_name='usuario')
    op.drop_table('usuario')
    op.drop_table('tipo_de_servico')
    op.drop_table('status')
    # ### end Alembic commands ###

"""empty message

Revision ID: d9c9512758a6
Revises: 
Create Date: 2021-05-10 16:20:44.375731

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('status',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('status', sa.String(length=55), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('tipo_de_servico',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome_servico', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('usuario',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nome', sa.String(length=255), nullable=False),
    sa.Column('cpf', sa.String(length=14), nullable=False),
    sa.Column('data_de_nascimento', sa.Date(), nullable=False),
    sa.Column('email', sa.String(length=255), nullable=False),
    sa.Column('senha', sa.String(length=255), nullable=False),
    sa.Column('telefone', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_usuario_email'), 'usuario', ['email'], unique=True)
    op.create_table('endereco',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('rua', sa.String(length=255), nullable=False),
    sa.Column('numero', sa.String(length=11), nullable=False),
    sa.Column('bairro', sa.String(length=255), nullable=False),
    sa.Column('cep', sa.String(length=11), nullable=False),
    sa.Column('referencia', sa.String(length=255), nullable=False),
    sa.Column('usuario_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['usuario_id'], ['usuario.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('ordem_de_serviço',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('data_solicitacao', sa.Date(), nullable=False),
    sa.Column('data_conclusao', sa.Date(), nullable=True),
    sa.Column('descricao', sa.String(length=511), nullable=False),
    sa.Column('imagem', sa.String(length=255), nullable=False),
    sa.Column('usuario_id', sa.Integer(), nullable=True),
    sa.Column('tipo_de_servico_id', sa.Integer(), nullable=True),
    sa.Column('status', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['status'], ['status.id'], ),
    sa.ForeignKeyConstraint(['tipo_de_servico_id'], ['tipo_de_servico.id'], ),
    sa.ForeignKeyConstraint(['usuario_id'], ['usuario.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('ordem_de_serviço')
    op.drop_table('endereco')
    op.drop_index(op.f('ix_usuario_email'), table_name='usuario')
    op.drop_table('usuario')
    op.drop_table('tipo_de_servico')
    op.drop_table('status')
    # ### end Alembic commands ###

empty message  Revision ID: d9c9512758a6 Revises:  Create Date: 2021-05-10 16:20:44.375731 # 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 ###