<?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 Version20251126073528 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 members_page (id SERIAL NOT NULL, member_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, avatar_file_name VARCHAR(255) DEFAULT NULL, avatar_dimensions JSON DEFAULT NULL, avatar_size VARCHAR(255) DEFAULT NULL, avatar_mine_type VARCHAR(255) DEFAULT NULL, avatar_original_name VARCHAR(255) DEFAULT NULL, update_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
        $this->addSql('CREATE UNIQUE INDEX UNIQ_5B6096857597D3FE ON members_page (member_id)');
        $this->addSql('COMMENT ON COLUMN members_page.update_at IS \'(DC2Type:datetime_immutable)\'');
        $this->addSql('ALTER TABLE members_page ADD CONSTRAINT FK_5B6096857597D3FE FOREIGN KEY (member_id) REFERENCES members (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 members_page DROP CONSTRAINT FK_5B6096857597D3FE');
        $this->addSql('DROP TABLE members_page');
    }
}
