<?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 Version20260121151117 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 contrats_line (id SERIAL NOT NULL, contrat_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, price1_day_ht DOUBLE PRECISION NOT NULL, price_sup_day_ht DOUBLE PRECISION NOT NULL, caution DOUBLE PRECISION NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
        $this->addSql('CREATE INDEX IDX_61D68661823061F ON contrats_line (contrat_id)');
        $this->addSql('ALTER TABLE contrats_line ADD CONSTRAINT FK_61D68661823061F FOREIGN KEY (contrat_id) REFERENCES contrats (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
    }

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