"""empty message

Revision ID: 11185c8cdf4c
Revises: 63bfa63f34e4
Create Date: 2021-08-20 13:35:29.015144

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

# revision identifiers, used by Alembic.
revision = '11185c8cdf4c'
down_revision = '63bfa63f34e4'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('panel')
    op.drop_table('marca')
    op.drop_table('oferta_grupo')
    op.drop_table('inversor')
    op.drop_table('producto')
    op.drop_table('oferta_condicionada')
    op.drop_table('oferta_excluyente')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oferta_excluyente',
    sa.Column('grupo_id', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('oferta', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['grupo_id'], ['oferta_grupo.id'], name='oferta_excluyente_ibfk_1'),
    sa.ForeignKeyConstraint(['oferta'], ['oferta_proveedor.id'], name='oferta_excluyente_ibfk_2'),
    sa.PrimaryKeyConstraint('grupo_id', 'oferta'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('oferta_condicionada',
    sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('oferta_1', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('oferta_2', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['oferta_1'], ['oferta_proveedor.id'], name='oferta_condicionada_ibfk_1'),
    sa.ForeignKeyConstraint(['oferta_2'], ['oferta_proveedor.id'], name='oferta_condicionada_ibfk_2'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('producto',
    sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('marca_id', mysql.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('type', mysql.VARCHAR(length=50), nullable=True),
    sa.ForeignKeyConstraint(['marca_id'], ['marca.id'], name='producto_ibfk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('inversor',
    sa.Column('id', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('modelo', mysql.VARCHAR(length=100), nullable=False),
    sa.Column('ficha_tecnica_key', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('min_wp', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('max_wp', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('kw_ac', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('max_vdc', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('max_isc', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('max_imc', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('min_mppt', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('max_mppt', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('num_mppt', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('strings', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('efc', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.ForeignKeyConstraint(['id'], ['producto.id'], name='inversor_ibfk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('oferta_grupo',
    sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('integrador_id', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['integrador_id'], ['integrador.id'], name='oferta_grupo_ibfk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('marca',
    sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('nombre', mysql.VARCHAR(length=75), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('panel',
    sa.Column('id', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('modelo', mysql.VARCHAR(length=100), nullable=False),
    sa.Column('ficha_tecnica_key', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('wp', mysql.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('vmp', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('imp', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.Column('efc', mysql.DECIMAL(precision=4, scale=2), nullable=False),
    sa.ForeignKeyConstraint(['id'], ['producto.id'], name='panel_ibfk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
