<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20260622171538 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE TABLE tenant_insurances (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, entity_type VARCHAR(10) NOT NULL, entity_id INT NOT NULL, insurance_id INT NOT NULL, version INT NOT NULL, is_active TINYINT NOT NULL, coverage_percent NUMERIC(5, 2) NOT NULL, franchise_rials INT NOT NULL, annual_ceiling_rials INT DEFAULT NULL, effective_from INT NOT NULL, effective_to INT DEFAULT NULL, created_at INT NOT NULL, updated_at INT NOT NULL, UNIQUE INDEX UNIQ_9C419AB7D17F50A6 (uuid), INDEX idx_tenant_insurance_active (entity_type, entity_id, is_active), UNIQUE INDEX uniq_tenant_insurance_version (entity_type, entity_id, insurance_id, version), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('DROP TABLE tenant_insurances');
    }
}
