<?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 Version20211206074513 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('ALTER TABLE cal_accommodation ADD cleaning_recurrence_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_accommodation ADD CONSTRAINT FK_2AA160DD41A1BFF8 FOREIGN KEY (cleaning_recurrence_id) REFERENCES cal_cleaning_recurrence (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2AA160DD41A1BFF8 ON cal_accommodation (cleaning_recurrence_id)');
$this->addSql('ALTER TABLE cal_cleaning_date ADD status VARCHAR(50) NOT NULL, DROP time, CHANGE date date DATETIME NOT NULL, CHANGE day cleaner_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_cleaning_date ADD CONSTRAINT FK_2DCEE9E0EDDDAE19 FOREIGN KEY (cleaner_id) REFERENCES cal_user (id)');
$this->addSql('CREATE INDEX IDX_2DCEE9E0EDDDAE19 ON cal_cleaning_date (cleaner_id)');
$this->addSql('ALTER TABLE cal_survey ADD cleaning_date_id INT DEFAULT NULL, ADD average_note INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_survey ADD CONSTRAINT FK_DC06541794C9BBC2 FOREIGN KEY (cleaning_date_id) REFERENCES cal_cleaning_date (id)');
$this->addSql('CREATE INDEX IDX_DC06541794C9BBC2 ON cal_survey (cleaning_date_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_accommodation DROP FOREIGN KEY FK_2AA160DD41A1BFF8');
$this->addSql('DROP INDEX UNIQ_2AA160DD41A1BFF8 ON cal_accommodation');
$this->addSql('ALTER TABLE cal_accommodation DROP cleaning_recurrence_id');
$this->addSql('ALTER TABLE cal_cleaning_date DROP FOREIGN KEY FK_2DCEE9E0EDDDAE19');
$this->addSql('DROP INDEX IDX_2DCEE9E0EDDDAE19 ON cal_cleaning_date');
$this->addSql('ALTER TABLE cal_cleaning_date ADD time TIME DEFAULT NULL, DROP status, CHANGE date date DATETIME DEFAULT NULL, CHANGE cleaner_id day INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_survey DROP FOREIGN KEY FK_DC06541794C9BBC2');
$this->addSql('DROP INDEX IDX_DC06541794C9BBC2 ON cal_survey');
$this->addSql('ALTER TABLE cal_survey DROP cleaning_date_id, DROP average_note');
}
}