"""Ajouter le module Matériel & Produits d'entretien.
Revision ID: 5784fc27cb2a
Revises: a07b8c9d0e2f
"""
from alembic import op
from app_new.core.models.cleaning import (
    ProductCategory, ProductGeneric, CommercialProduct, ProductPackaging,
    StockLocation, StockLot, StockLotBalance, StockMovement,
    MaterialAssignment, ReusableContainer, ContainerFill, ProductDocument,
    RequestProfile, RequestProfileItem, StockInventory, StockInventoryLine,
    CleaningForecastConfig,
)
revision = "5784fc27cb2a"
down_revision = "a07b8c9d0e2f"
branch_labels = None
depends_on = None
_TABLES = [
    CleaningForecastConfig.__table__, ProductCategory.__table__,
    RequestProfile.__table__, ProductGeneric.__table__, CommercialProduct.__table__,
    RequestProfileItem.__table__, ProductDocument.__table__, ProductPackaging.__table__,
    ReusableContainer.__table__, StockLot.__table__, StockLocation.__table__,
    MaterialAssignment.__table__, StockInventory.__table__, StockLotBalance.__table__,
    StockMovement.__table__, ContainerFill.__table__, StockInventoryLine.__table__,
]
def upgrade():
    bind = op.get_bind()
    for table in _TABLES:
        table.create(bind=bind, checkfirst=True)
def downgrade():
    bind = op.get_bind()
    for table in reversed(_TABLES):
        table.drop(bind=bind, checkfirst=True)

