<?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 Version20250428094124 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(<<<'SQL'
            ALTER TABLE location ADD is_start_end TINYINT(1) NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE trip ADD completed TINYINT(1) NOT NULL, DROP captain_name
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE trip_location ADD is_transit TINYINT(1) NOT NULL, ADD is_departure TINYINT(1) NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE user ADD is_pilot TINYINT(1) NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE user_trip ADD approved TINYINT(1) NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE vessel ADD length DOUBLE PRECISION DEFAULT NULL, ADD breadth DOUBLE PRECISION DEFAULT NULL, ADD draft DOUBLE PRECISION DEFAULT NULL, ADD gross_tonnage DOUBLE PRECISION DEFAULT NULL, ADD imo_no VARCHAR(255) DEFAULT NULL, ADD call_sign VARCHAR(255) DEFAULT NULL
        SQL);
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql(<<<'SQL'
            ALTER TABLE location DROP is_start_end
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE `user` DROP is_pilot
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE vessel DROP length, DROP breadth, DROP draft, DROP gross_tonnage, DROP imo_no, DROP call_sign
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE trip_location DROP is_transit, DROP is_departure
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE trip ADD captain_name VARCHAR(255) DEFAULT NULL, DROP completed
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE user_trip DROP approved
        SQL);
    }
}
