<?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 Version20260206200000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add status and account relation to etat_lieux';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE etat_lieux ADD account_id INT DEFAULT NULL');
        $this->addSql("ALTER TABLE etat_lieux ADD status VARCHAR(50) DEFAULT 'delivery_progress' NOT NULL");
        $this->addSql('ALTER TABLE etat_lieux ADD CONSTRAINT FK_D71603599B6B5FBA FOREIGN KEY (account_id) REFERENCES account (id)');
        $this->addSql('CREATE INDEX IDX_D71603599B6B5FBA ON etat_lieux (account_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE etat_lieux DROP FOREIGN KEY FK_D71603599B6B5FBA');
        $this->addSql('DROP INDEX IDX_D71603599B6B5FBA ON etat_lieux');
        $this->addSql('ALTER TABLE etat_lieux DROP account_id');
        $this->addSql('ALTER TABLE etat_lieux DROP status');
    }
}
