<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20260603130000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Supprime les tables audit des entites sorties du perimetre de suivi.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('DROP TABLE IF EXISTS news_category_translation_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS shop_delivery_method_category_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS news_category_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS event_event_image_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS business_version_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS depot_category_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS shop_delivery_method_category_translation_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS depot_category_translation_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS user_invoice_address_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS news_news_image_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS client_email_group_mapping_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS contact_contact_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS user_delivery_address_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS library_library_translation_audit CASCADE');
        $this->addSql('DROP TABLE IF EXISTS library_library_audit CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS shop_delivery_method_category_translation_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS client_email_group_mapping_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS contact_contact_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS depot_category_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS depot_category_translation_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS event_event_image_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS library_library_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS library_library_translation_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS news_category_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS news_news_image_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS news_category_translation_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS shop_delivery_method_category_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS user_delivery_address_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS user_invoice_address_audit_id_seq CASCADE');
        $this->addSql('DROP SEQUENCE IF EXISTS business_version_audit_id_seq CASCADE');
    }

    public function down(Schema $schema): void
    {
        $this->throwIrreversibleMigrationException('Les entites concernees ne sont plus auditees.');
    }
}
