<?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 Version20220928162504 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 cal_accommodation_management (id INT AUTO_INCREMENT NOT NULL, internet_technical_area LONGTEXT DEFAULT NULL, has_management TINYINT(1) DEFAULT NULL, contact VARCHAR(100) DEFAULT NULL, email VARCHAR(100) DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, management_fees INT DEFAULT NULL, rental_fees INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE cal_accommodation_contract ADD subscription_date DATE DEFAULT NULL, ADD phone VARCHAR(20) DEFAULT NULL');
$this->addSql('ALTER TABLE cal_accommodation_info ADD management_id INT DEFAULT NULL, ADD communal_heating TINYINT(1) DEFAULT NULL, ADD wifi_code VARCHAR(255) DEFAULT NULL, ADD maintenances_fees INT DEFAULT NULL, ADD min_maintenances_fees INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_accommodation_info ADD CONSTRAINT FK_6B3EF6D880D51D0E FOREIGN KEY (management_id) REFERENCES cal_accommodation_management (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6B3EF6D880D51D0E ON cal_accommodation_info (management_id)');
$this->addSql('ALTER TABLE cal_cleaning_recurrence ADD fees_type VARCHAR(50) DEFAULT NULL, ADD owner_fees INT DEFAULT NULL, ADD roommate_fees INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_accommodation_info DROP FOREIGN KEY FK_6B3EF6D880D51D0E');
$this->addSql('DROP TABLE cal_accommodation_management');
$this->addSql('ALTER TABLE cal_accommodation_contract DROP subscription_date, DROP phone');
$this->addSql('DROP INDEX UNIQ_6B3EF6D880D51D0E ON cal_accommodation_info');
$this->addSql('ALTER TABLE cal_accommodation_info DROP management_id, DROP communal_heating, DROP wifi_code, DROP maintenances_fees, DROP min_maintenances_fees');
$this->addSql('ALTER TABLE cal_cleaning_recurrence DROP fees_type, DROP owner_fees, DROP roommate_fees');
}
}